I have three dropdown lists (country, city, hotel).
The steps are like this:
1.countries name shows in the country dropdown list, city and hotel dropdown lists are empty.
2. select country, then the city dropdown lists will show the cities in the selected country only.
3. select a city, then the hotel dropdown lists will show the hotels in the selected city only.
list of countries, cities and hotels are all from database.
Use an XMLHttpRequest object to call a php/asp/etc script that calls the database and returns the selected list, then parse the list of options into the select box.
I recently wrote a demo for someone requesting something similar to this. It doesn't use XHR but it might give you some ideas.