Country Selection list with State and Province selections

[UPDATE] Comments are closed on this topic – The download is no longer supported or updated and has been removed

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.


Posted

in

, ,

by

Tags:

Comments

21 responses to “Country Selection list with State and Province selections”

  1. Jason Dugmore Avatar

    Hey man, like the new look of your site! Cool to see you doing code tuts now as well, hope to see more ssoon.

  2. Robin Avatar

    Wow! Thanks Mike, will come in handy.

  3. Country Selection list with State and Province selections…

    XML list of all countries and related areas/states….

  4. admin Avatar
    admin

    @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.

  5. Robin Avatar

    Hey mike. I used your list in a AJAX selection script i needed. I imported it to a DB and pull the area based on country using AJAX. I put it on my blog, feel free to use: http://www.noboxmedia.com/20/massive-ajax-countryarea-drop-down-list/

  6. […] JavaScript. They found almost all countries and their associated areas compiled as a XML list (from darwinshome.co.za). They took this XML list, converted it to CSV and imported to it to a MySQL database. They then […]

  7. Michael Avatar

    Thanks Robin – Excellent work.

  8. twocans Avatar

    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

  9. Michael Avatar

    @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.

  10. Kenny Avatar
    Kenny

    Michael thanks for everything.

    cheers

    k

  11. […] « Country Selection list with State and Province selections […]

  12. Ryan Fogle Avatar
    Ryan Fogle

    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)

  13. Michael John Grove Avatar

    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.

  14. Michel Onstein Avatar

    Awesome list,

    how about adding the official two character and three character country codes to the list?

  15. Sid Avatar
    Sid

    The list was way too awesome.Man, I really cannot thank u enough.

  16. Michael John Grove Avatar

    @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 🙂

  17. tim Avatar
    tim

    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.

  18. Michael John Grove Avatar

    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.

  19. Lillo Avatar
    Lillo

    In Italy Abruzzi is Abruzzo
    bye

  20. satya Avatar
    satya

    ThanQ! 🙂