Find value of selected item in Drop down menu.

Posted by Ozaki on Stack Overflow See other posts from Stack Overflow or by Ozaki
Published on 2010-03-11T05:32:50Z Indexed on 2010/03/11 5:36 UTC
Read the original article Hit count: 260

Filed under:
|
|
|
|

I have a drop down menu in an ASPX page along the lines of:

 <form>
 <select name="cars">
 <option value="volvo">Volvo</option>
 <option value="saab">Saab</option>
 <option value="fiat" selected="selected">Fiat</option>
 <option value="audi">Audi</option>
 </select>
 </form>

That is dynamically generated from another controller (value and label).
After the user selects one of the options I need to find out what the selected value/label (will be the same) is so I can hit an update button and retrieve the data on that option.
What would be the easiest way to find out the value of the user "selected" option?

© Stack Overflow or respective owner

Related posts about html

Related posts about asp