SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    get all options from a select box

    How do I get all options from a select box not just selected ones?

    monkey
    monkey - the rest is history

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just get a reference to the containing Select object, and loop through its .options collection, index by index, from i=0 to i<Select.options.length. Each option can be retrieved as Select.options[i].

    Didn't say what you wanted to do with them!
    ::: certified wild guess :::

  3. #3
    SitePoint Wizard boxhead's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    1,040
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by adios
    Just get a reference to the containing Select object, and loop through its .options collection, index by index, from i=0 to i<Select.options.length. Each option can be retrieved as Select.options[i].

    Didn't say what you wanted to do with them!

    Yup, managed to sort it exactly that way - cheers.

    monkey
    monkey - the rest is history


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
  •