Get Text from dropdown list using javascript

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.
 
M

moondaddy

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


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top