Country Selection list with State and Province selections

[UPDATE] Comments are closed on this topic – Should you spot any mistakes or if I have missed a province/state – please email me at michael [at] darwinshome [dot] za [dot] net

Country State XML exampleI have been looking all over the Internet for an AJAX or similar dynamic drop down tool for Country and Province/State selection (You select a country from a drop down list and the country/state drop down selection automatically populates with that countries list of provinces or states)

The good news is I found various versions, from ASP.NET controls, to simple JavaScript files, but the catch was that although I had the tool, the tool, didn’t have all the counties of the world, never mind their respective states or provinces.

So after much trawling, and searching, I have a complete world country list (including Antarctica) with their respective states and I have placed them all together into an XML file for ease of development use:

– [download#4] - [29.3 KB ZIP file]

Please leave a comment should any errors exist in the file, from broken XML, to incorrect spelling, to having a province not listed, I will fix it if it checks out.

Hope it helps.

[EDIT1 11/03/2008] – Removed Yugoslavia. Changed “Macedonia, Former Yugoslav Republic of” to “Macedonia”. Added Serbia and Montenagro, with states. Thank you omBRE for pointing out my error on the NoBox Media blog.

[EDIT2 24/04/2008] – Corrected spelling of Antarctica (Thanks Ryan) and updated the “Regions” in New Zealand (Thanks David for pointing that out over on the NoBox Media blog).

[EDIT2 08/05/2008] – Corrected spelling of Czech Republic, Thanks Tim.

License and Copyright:
The country and province names in the file are public domain.
XML file in its current format is licensed to Michael John Grove under the Creative Commons Attribution 2.5 South Africa License.

21 thoughts on “Country Selection list with State and Province selections

  1. Pingback: goguide.co.za
  2. admin says:

    @Jason: Thanks boet – busy ironing out the kinks still, I think I will be done with the whole site by Friday. And Yes, I hope to have more up soon.

    @Robin: No problem, I still plan on building a few tools that use the file.

  3. Hi yea,
    Thanks for the code and great site.

    Just wondering, the country list, you havn’t added the UK, is there any other countries you might have forgotton.

    regards

    k

  4. @K – Thanks for the reply.

    I seperted UK into it’s seperate countries and states; so I listed England (with states), Scotland (with states), Northern Ireland (listed “Ireland, Northern” with states) and Wales (with her states) all separately.

    Hope this helps.

  5. Pingback: One developers guide to sanity » JavaScript / XML based Country, State Selection Script :: Blog ::
  6. Ryan Fogle says:

    Michael,

    Thanks for all the work. This is very helpful. One minor correction. The xml file has Antarctica listed as Antartica (missing the first c)

  7. Thank you Ryan

    I have updated the XML file to reflect the correct spelling of Antarctica – well spotted.

    I also updated New Zealand to be a closer reflection of the counties regional splits.

  8. @Michel – Adding the official ISO codes is on my list of things I would like to do, but as the Standards Organisation actually charges for the full database list of counties with the 2 and 3 character ISO codes I may run into some issues.

    I am in the process of researching my limits in this regard.
    In the mean time you can find more information here: http://www.iso.org/iso/country_codes/

    @Sid: Only a pleasure 🙂

  9. tim says:

    Two points:
    Should czeck republic be czech republic?

    and

    the areas given for the UK are not states (as described in a comment above) but counties or unitary authorities.

    If you are interested have a look at
    http://www1.landregistry.gov.uk/houseprices/ and click on
    View the latest statistical release for some additional detail/statistics.

    Otherwise an excellent list, and I’m just off to check out your licencincg arrangement.

  10. Hi Tim

    Thanks for the correction on the Czech Republic – I will update the XML file shortly.

    A list like this that does not follow the ISO standards with countries will have some oddities with regards to state, province and county definitions.

    Another example of an oddity in this list is New Zealand which has no provinces, states or counties but rather ‘municipal districts’.

    I have tried to allow for as many areas as I can I the list, although in future versions I may integrate the UK into one unit, as per ISO standards.

    Also, thank you for the link it will come in handy in the future.

Comments are closed.