PDA

Click to See Complete Forum and Search --> : Referencing the value of a drop-down box


Stephen Warker
Nov 21st, 2000, 02:26 PM
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?

Nov 21st, 2000, 03:00 PM
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