Dynamically Populating Select Menus Client-Side (Page 1 of 4 )
I feel I need to explain exactly what it is this little magic trick does. Picture a registration form, one where you have to input your country and state/province of residence. What if the form could give you a menu of selectable countries, and then generate another for you listing the logically available states/provinces to choose from. This would eliminate the need for users to type in their state/province, and also prevent them from having to scroll through one massive list of all possible states/provinces in all countries.
Now you're already thinking that this can be done server-side. We could simply reload the page when the first menu changes (user selects a country), and populate the second menu with items associated with the selected item of the first. While this is all well and good, this requires another hit to the server and trip to the database, thus slowing things down for everyone. If we can push this piece of processing off to the client's browser, why not do it?
Another example could be in the search form of an e-commerce website. A user selects from a list of categories that they're looking for a laptop, and immediately the next menu allows them to select from the possible manufacturers that you stock. Now are you starting to see the usefulness of this? If so, continue to read on, I'll show you how it's done.