Country/State Dynamic Drop Down List

心已入冬 提交于 2019-12-07 08:35:50

问题


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?


回答1:


Regarding the data: Country, State, Province WebService?




回答2:


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

Demo




回答3:


The CascadingDropdown control will give you this behavior.




回答4:


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.




回答5:


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.



来源:https://stackoverflow.com/questions/1241347/country-state-dynamic-drop-down-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!