CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    90

    Display the content of the text box portion of a dropdown in javascript

    I want to know what property in java script allows to refer to the content the value of the text box portion of a dropdown list. I know the property "SelectedIndex" refers to the value (index). For example if the selected value of the dropdown list is 2 and the corresponding text is "United States" what property in Java script will allow me to refer to the content "United State"?

  2. #2
    Join Date
    Aug 2002
    Location
    Reykjavik, Iceland
    Posts
    201
    document.forms['yourformname'].elements['selectname'].options[document.forms['yourformname'].elements['selectname'].selectedIndex].text



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured