I am trying to grab the value of the selected item in a drop-down(select) box. I have tried select1.selecteditem.value, but that is not a property. Any help?
Printable View
I am trying to grab the value of the selected item in a drop-down(select) box. I have tried select1.selecteditem.value, but that is not a property. Any help?
If you have a SELECT setup with VALUE attributes, ex:
<SELECT NAME="selWhatever">
<OPTION VALUE="Red">Red
<OPTION VALUE="Green">Green
<OPTION VALUE="Blue">Blue
</SELECT>
...then you can get the value of the select with selectName.value, for example:
alert(selWhatever.value)
Hope this helps,
Paul