View Full Version : Multiple Drop Down Lists
Thatguy2001au
10-21-2002, 06:20 AM
Hey Everyone!
I was just wondering how to populate a second drop down list depending on what was selected from the first one.
Any ideas???
It would be better if these values for the drop down lists came from values stored into a database but doesn't really matter either way. I have no problem coding the values into the script.
whammy
10-21-2002, 07:18 AM
Didn't you post this a couple of weeks ago? Or was that someone else?!?
This question sure seems familiar... perhaps a search of the forums may yield an answer?
And if you're using a database, it's easy... just populate the second dropdown list with the results from your database query. If you want to do it without refreshing the page, then you need to probably get all of the possible values from the server (it's just like the multiple combo scripts on javascriptkit.com, but you have the luxury of prepopulating the arrays dynamically!) and then put them into a javascript array... since you apparently don't want to send another request to the server.
Thatguy2001au
10-21-2002, 08:01 AM
Thanks Whammy
I haven't posted this before but i will have a look through to see who did and see how they did it. I will also look at javascrips.com and see how it is done without refreshing
thanks.
whammy
10-21-2002, 03:40 PM
Well... it's fairly simple, unless you want to get ALL possible selections, etc. from your database when the page is LOADED (and then pass it to javascript), which could be extremely complicated and impractical depending on the data, you DO have to send a request to the server - but you can do it in a hidden frame or something, and then have those values passed to your "main" page...
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.