Selecting items in a list box

Discussion in 'Javascript' started by Mark, Oct 31, 2003.

  1. Mark

    Mark Guest

    Hi - I have a droplistbox which has some items in the form of a tree
    type structure (file system) - this is how it appears exactly - the
    value attribute is just a consecutive number:

    Root
    Root | Business
    Root | Business | Excel
    Root | Business | Excel | Formulas
    Root | Business | Excel | Formatting
    Root | Fun
    Root | Fun | Music
    Root | Fun | Music | MP3s
    Root | Fun | Music | CDs


    If I click on a listitem (for example: Root | Business | Excel |
    Formatting) - I want to be able to take the string Root | Business |
    Excel | Formatting - and select automatically the Root, Root | Business
    and Root | Business | Excel list items too - in other words, providing a
    complete path back to the root - without affecting the other list items.

    Is there a way in Javascript to take the listitem I've selected, split
    it by the | character so I end up with an array like:

    arr1("Root |" , "Root | Business |" , "Root | Business | Excel |")

    ...and then iterate through the list items, and select them if they
    match an enty in my array?

    Thanks for any help with this,

    Mark

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Mark, Oct 31, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott324
    Replies:
    3
    Views:
    4,508
    Jason Kester
    Oct 27, 2005
  2. Anjan Bhowmik
    Replies:
    1
    Views:
    488
    Misbah Arefin
    Feb 14, 2008
  3. mldardy
    Replies:
    1
    Views:
    761
    mldardy
    Dec 10, 2008
  4. newcomer

    help with selecting items in a list box

    newcomer, Nov 24, 2004, in forum: Javascript
    Replies:
    1
    Views:
    118
    Yann-Erwan Perio
    Nov 24, 2004
  5. Brian
    Replies:
    4
    Views:
    372
    Joshie Surber
    Nov 19, 2005
Loading...

Share This Page