I’ve recently come across something like:
-
<form method="get" action="/somewebdir/script.php"> <input type="radio" name="param0" value="foo" /> <input type="radio" name="param1" value="foo" /> <input type="radio" name="param2" value="bar" /> <input type="radio" name="param2" value="bar" checked="checked" /> </form>
I was curious if there was a way to send multiple key/values, if the second param2 is sent, without any JS.
So that the page would result to something like:
-
http://domain/somewebdir/script.php?param2=bar¶m3=foobar
I changed the value from "bar" to "bar&param3=foobar", but obviously the special chars (& and =) will be encoded.
Any ideas? (again w/o JS)
Hidden elements won’t work as it will always send the parameter, which would have a negative affect on other things being called by the handler (script.php)
No, it can’t be done. Instead, do it from the server side (as in, expect the input, and if it arrives act accordingly). If it’s not coming from the user, it’s not user input!
If you need a specific value for each user, you can use a hidden input, and cross check that with your radio button.