Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Selecting items in a list box

Thread Tools

Selecting items in a list box

Posts: n/a
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 | 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,


*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help selecting items from a list box trigger by what selected in dropdown list mldardy ASP .Net 1 12-10-2008 02:24 AM
Is there any way to append some items to List box, without retrieving all items through AJAX? Anjan Bhowmik ASP .Net 1 02-14-2008 09:02 PM
Selecting items in a list/menu with javascript Brian Javascript 4 11-19-2005 03:19 AM
Accessing List Items that were added to a list box via JavaScript Scott324 ASP .Net 3 10-27-2005 09:17 PM
help with selecting items in a list box newcomer Javascript 1 11-24-2004 08:50 PM