SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2006
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get the value from a drop down list

    var newCorporateBodyTypeMenu = document.getElementById(newCorporateBodyTypeMenuId);

    once i have this menu object how to i get the selected option text

    when i do .value i get the index of the selected item, however i need the value of what's in the drop down

    cheers

  2. #2
    SitePoint Zealot
    Join Date
    Apr 2006
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    got it... for reference its:

    newCorporateBodyTypeMenu.options[newCorporateBodyTypeMenu.selectedIndex].text

    woohoo

  3. #3
    SitePoint Addict jtrelfa's Avatar
    Join Date
    Oct 2004
    Location
    Troy, Mi
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you considered the prototype library?

    newCorporateBodyTypeMenu.options[newCorporateBodyTypeMenu.selectedIndex].text

    becomes: $F(newCorporateBodyTypeMenu)


Bookmarks

Posting Permissions

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