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:

Country State/Province XML lis (2410) - [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.

Like this post? Share it:
Save to del.icio.us   Digg it!   Share on facebook   Add to my Technorati Favorites   Share on GoGuide   Stumble!   reddit this!   Add to Google Bookmarks   Seed Newsvine   Add to Muti

21 Comments to 'Country Selection list with State and Province selections'

Subscribe to comments with RSS

  1. 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 said,

    Wow! Thanks Mike, will come in handy.

  3. authour icon
    admin said,

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

  4. Robin said,

    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/

  5. authour icon
    Michael said,

    Thanks Robin – Excellent work.

  6. twocans said,

    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

  7. authour icon
    Michael said,

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

  8. Kenny said,

    Michael thanks for everything.

    cheers

    k

  9. Ryan Fogle said,

    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)

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

  11. Awesome list,

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

  12. Sid said,

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

  13. @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 :)

  14. tim said,

    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.

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

  16. Lillo said,

    In Italy Abruzzi is Abruzzo
    bye

  17. satya said,

    ThanQ! :)

:: Trackbacks/Pingbacks ::

  1. Trackback by goguide.co.za - on February 19th, 2008 at 4:37 pm

  2. Pingback by Massive AJAX Country/Area Drop-down List | Nobox Media - on February 20th, 2008 at 8:43 am

  3. Pingback by Layoutica.com - AJAX Country/Area Drop-down List - on February 20th, 2008 at 12:30 pm

  4. Pingback by One developers guide to sanity » JavaScript / XML based Country, State Selection Script :: Blog :: - on March 2nd, 2008 at 10:42 pm