hello,

pls help.:-|

i have 3 dropdown lists: country, city and area. when i select a country, the values in the city and area dropdown lists should change automatically without reloading the page. the cities and areas to appear must be in that country. same thing goes with areas in the city selected.
:rolleyes:

thanks in advance and more power to you!!:)

You can use an AJAX solution to your problem. Let's say that we have three page: main.asp (which holds 3 selectbox you mentioned), city.asp (that returns cities of requested country), area.asp (that returns areas of requested city)

So you should get country list while main.asp is loading. If any country selected, with Javascript (with xmlhttp object), you should request city.asp with a proper query defining which country you selected. (for example: city.asp?countryID=1). city.asp should return list of cities of the requested country. In main.asp, after getting cities from city.asp with javascript, you should create all new options for selectbox (cities).

So when a city selected, same process should be handled. A request for area.asp?cityID=1 is triggered with javascript, get area list and create all selectbox options for areas.

Maybe I could not explain in a clear way, if you have difficulties I can write an example for you.

Maybe I could not explain in a clear way, if you have difficulties I can write an example for you.

Gee, thanks. That would help. You have mentioned xmlhttp(??) Sorry, but i'm not familiar with it. :confused: By the way, all values are generated from a database.

Have a nice day!!:)

This article has been dead for over six months. Start a new discussion instead.