Get Text from dropdown list using javascript

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

I'm using the asp.net dropdownlist in a datagrid row item template. using
client side JavaScript, I need to get the text from the selected item in the
dropdown list to update the corresponding grid cell. This dropdown list
uses numbers for the values, and text as the display text, therefore, I cant
use the dropdownlist.value for this.

Any suggestions?

Thanks.
 
Found it. Not extactly intuitive, but does exatly what I wanted.


alert(cmbType.options[cmbType.selectedIndex].text);
 
Back
Top