Does anyone know if it's possible to pass a hidden request parameter in with a <select>
<option>
element in a HTML form?
So for example, if the user selected <option value="foo">foo</option>
from a <select>
list of options, could I somehow pass a hidden value in, as well as the "foo" value, and retrieve that as a request parameter? E.g. <input type="hidden" name="x" value="bar"/>
would enable me to get the values "foo" and "bar" from the request when the user selected the foo option.
Thanks
You can specify either 'hidden' (without value) or 'hidden="hidden"'. Both are valid. A hidden <select> element is not visible, but it maintains its position on the page.
It is not possible to hide elements from the DOM inspector, that would defeat the purpose of having that tool. Disabling javascript is all it would take to bypass right click protection. What you should do is implement a proper autologin.
If you need to use a hidden field for each options of the select dropdown, you can set that value in your own attribute in tag, instead of setting it into hidden field.
<option value="foo" fooData="foo|bar">foo</option>
<option value="foo2" fooData="foo2|bar2">foo2</option>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With