views:

1061

answers:

5

If you go to http://profile.microsoft.com and edit your personal information, you will select your country. When a country is selected the city and/or state information changes based on what is expected for that country. Does anyone have any examples on how to accomplish this? Is there any service (free service) that provides this information?

+3  A: 

Because you tagged your question with "jquery", here is an example of a "Depending / Cascading Selectbox" (which you are searching)

Demo

Henrik P. Hessel
I looked at those as well. They don't really offer the functionality I need. If the country selected does not need a state, the select should disappear. I don't think there is anything like that, so I'll have to write my own.
Wili
+2  A: 

The CascadingDropdown control will give you this behavior.

lance
A: 

Well it's based on your IP tracking, you can find users country via his IP address, all the list of Cities, for specific countries you can find somewhere and add it to your functionality, also you probably need some ajax functions for filing up drop downs or even better a JSON.

vaske
This doesn't necessarily need to use an IP to country database. Since when is Ajax a type of function? And, JSON would be a nice way to save the cities for each country, but it is not a way to populate this information.
Sinan Taifour
You can always track IP of user and got his country, and set the value in country drop down box on it, that was my idea, but of course I'm agree with you that is not necessarily in every case, that is one advance feature.
vaske
+1  A: 

You have to use Javascript to dynamically populate the city/state SELECT tag whenever the country SELECT tag is changed, which you can catch using an Event Handler.

Sinan Taifour
+2  A: 

Regarding the data: Country, State, Province WebService?

lance