Skip to content
Advertisement

two values for one name in input

I have one input (type radio) that I want to insert it 2 values, something like that:

JavaScript

And after draw each value seperated with PHP.

There is a way to do it? (And no.. I dont want to insert input with type=”hidden”)

Thank you.

Advertisement

Answer

Well, not the way I would do it, but you could use a delimiter for your value(s)

JavaScript

Then, in PHP, just list($value1,$value2) = explode('|', $_POST['two_values']);

EDIT
As @user387302 said, you would obviously be limited to not having any values containing your delimiter, for example value="One|PipedVariable|andAnother" would not work to extract two values of “One|PipedValue” and “andAnother”

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement