Selecting items in a list box

M

Mark

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top