Could someone please show me how to access the value of a select? Here is where I call the function:
<select name="select1" onChange="changeTotal(this,this.selectedIndex);">
<option value"1">option 1</option>
<option value"2">option 2</option>
</select>
This is what doesn't work:
function changeTotal(oSelect,nSelectIndex)
{
alert( oSelect.options[nSelectIndex].value );
}
The strange thing is that if I change it to .text at the end it gets the text of the option!
Any help would be greatly appreciated.
<select name="select1" onChange="changeTotal(this,this.selectedIndex);">
<option value"1">option 1</option>
<option value"2">option 2</option>
</select>
This is what doesn't work:
function changeTotal(oSelect,nSelectIndex)
{
alert( oSelect.options[nSelectIndex].value );
}
The strange thing is that if I change it to .text at the end it gets the text of the option!
Any help would be greatly appreciated.