Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Splitting an array and recombining with combo boxes

Status
Not open for further replies.

databit

Programmer
Sep 12, 2002
84
US
OK I don't even know what to search for with this. I could probably do it with about 900 nested ifs but I'm betting there is a much more efficient way of doing it.

index varCode[index] varDescription[index]
0 10 cat_old_survived
1 20 cat_old_died
2 30 dog_young_playful
4 31 dog_old_dead
5 32 human_middleaged_alcoholic

Right now these are placed into 1 combo box with the following contents
10 cat_old_survived
20 cat_old_died
30 dog_young_playful
31 dog_old_dead
32 human_middleaged_alcoholic

What I need to do is create 3 context sensitive dropdown boxes
First box:
cat
dog
human

If user selects dog then second box has:
young
old

If they select old third box just has:
dead

Now for the fun part. After user has selected all 3 options it needs to associate it back to the corresponding code. In the above example:
Combo1 = dog
Combo2 = old
Combo3 = dead
would equal
varDescription = dog_old_dead
varCode = 31


Does this make any sense to anyone but me? If so any suggestions?
 
At the time of writing this I hadn't because I had no idea what to look for. It's apparently called Multi-Level Select so now I have that sample which is perfect.
One thing I can't find though, is it possible to pass a very large array to the html page/javascript via a server side application (java, php, etc)?
 
How large is 'very' large? If it's, say, 10-20Kb or so, you could deliver it to the page in JS.

OR, if it's really much bigger, perhaps 50-500Kb or more, I'd investigate AJAX, more of which can be found in forum1600.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top