If I have a combobBox with values red/white/blue
and the users chooses blue
then I want my form action php page to use the value 2, not `blue. I hope you see what I mean.
Is there any easy way to do that?
If I have a combobBox with values red/white/blue
and the users chooses blue
then I want my form action php page to use the value 2, not `blue. I hope you see what I mean.
Is there any easy way to do that?
You do this by constructing your form appropriately and supplying a value
attribute:
<option value="2">blue</option>
<form action='phpPage.php' name='bsForm' method='POST'>
<select name='TheColor' onSelect="bsForm.submit()">
<option value='0'>red</option>
<option value='1'>white</option>
<option value='2'>blue</option>
</select>
</form>
If your form looks anything like that, then your phpPage should easily be able to get the value 2 from $_POST['TheColor']