Forum Moderators: open
I'd like to find out how this is done:
A website has a dropdown list of, for example, state names.
When you select a state name, the next dropdown list will change to show that states cities or similar. Categories based on the state or whatever.
I'm pretty sure this would be retrieved from a database, just wondering how most of you would handle this and if there's a preferred way to do it.
Where can one learn how to do this?
Thanks for your time and experience,
Skip
This is possible to do all at the front end (you can still get all the options from a DB though!) using JavaScript.
It involves using arrays and the onchange method. Basically, depending on whay option is selected in one dropdown list you populate the next dropdown list with the values stored in the corresponding array.
There are tutorials on the web for this and also check out the Javascript Forum [webmasterworld.com] here for some great script resources.
HTH