Get Option NAME in form, not TEXT
Hey team,
I'm trying to get the OPTION name from a FORM, and not the actual selected text:
Code:
<form method="get" action="test.php">
<select name="test">
<option name="1">Option One</option>
<option name="2">Option Two</option>
<option name="3">Option Three</option>
</select>
<input type="submit" name="action" value="Submit">
</form>
This works, but is giving me the 'Option One' text, and I'd like to get the number 1 from NAME instead.
Re: Get Option NAME in form, not TEXT
Got it!
Name should have been value:
Code:
<form method="get" action="test.php">
<select name="test">
<option value="1">Option One</option>
<option value="2">Option Two</option>
<option value="3">Option Three</option>
</select>
<input type="submit" name="action" value="Submit">
</form>