JavaScript:Syntax!_NEWLINE_!How to get the values from a drop down list, which is populated by a vector
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   al_still
Posted On:   Wednesday, January 2, 2002 08:09 AM

Hi, I have a dropdown list from a

However I am trying to use javaScript to get the selected value of the list. But when I use var val = window.document.formName.selectName.options[indx].value

What I am trying to get is the value that was in the vector and has been selected from the drop down list Thanx

Re: JavaScript:Syntax!_NEWLINE_!How to get the values from a drop down list, which is populated by a vector

Posted By:   Arun_Bharathan  
Posted On:   Wednesday, January 2, 2002 08:44 AM

For the option object in javascript, there is a value attribute and a text attribute. So in your case, option.index contains the loop index and option.text contains the vector value.


Use this to get to the text displayed in the Drop down.



window.document.formName.selectName.options[indx].text
About | Sitemap | Contact