Richard Korts
asked on
Select Option Value
If you have an HTML select element and an option like <option>--</option> and that is the default one selected, in the php processing program, does it pass "Null" as the value?
That is, is $_REQUEST['select name'] == "" ?
Thanks
That is, is $_REQUEST['select name'] == "" ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yep
ASKER
One more thing. If I am doing Javascript edits IN the html page with the form, is the javascript value of the form element "" or "--"?
Thanks
Thanks
Can be either.
With javascript to get the displayed value you use
.options[e.selectedIndex]. text
And to get the option value you use
.options[e.selectedIndex]. value
With javascript to get the displayed value you use
.options[e.selectedIndex].
And to get the option value you use
.options[e.selectedIndex].
ASKER
So the value, if unspecified, would be null?
Yep
ASKER
So to get "", I have to say <option value="">--</option>?
Thanks