Country/City/state validation

M.M.H.Masud picture M.M.H.Masud · Feb 8, 2010 · Viewed 11.1k times · Source

I want to do the following things using PHP and jQuery

https://www.careerbuilder.com/share/register.aspx?sc_cmp1=JS_LoginASPX_RegNow

Steps

  1. Select a country from a dropdown list.
  2. The city dropdown list will fillup automatically with the list of cities of the selected country.
  3. If state is available for that country then state list will be visible with all state list of that country.

Then I need to validate the selected city, state and country.

Do you have any ideas?

Thanks in advance

Answer

jarnbjo picture jarnbjo · Feb 8, 2010

If you want to make it easy for foreigners to enter an address, then please simply offer a text field, where the address can be entered as formatted text. Very few countries are using a state (or something similar) as part of the address and I don't understand why you want to offer a drop-down list with cities. A list of German cities (or more correct, valid place names in a postal address) would contain some 23,000 entries. What do you think is more easy, enter the address or try to find the place name in such a list_