MOVED: My blog is now at

Code bits: Country select box

Here's something that has been burning a hole in my library for a while and I never thought to put it up here. Thankfully, now I have realised that it could be useful to my colleagues around the world (although in this version the UK is selected). It was fully revised in March 2007 from ISO 3166-1 Alpha-2 country codes. Each country's corresponding "value" property is the two-letter country code from the ISO. Use it in your code freely, but please link here if you want to share the code with others. Enjoy...

<option value="AF">AFGHANISTAN</option>
<option value="AX">Ă…LAND ISLANDS</option>
<option value="AL">ALBANIA</option>
<option value="DZ">ALGERIA</option>
<option value="AS">AMERICAN SAMOA</option>
<option value="AD">ANDORRA</option>
<option value="AO">ANGOLA</option>
<option value="AI">ANGUILLA</option>
<option value="AQ">ANTARCTICA</option>
<option value="AG">ANTIGUA AND BARBUDA</option>
<option value="AR">ARGENTINA</option>
<option value="AM">ARMENIA</option>
<option value="AW">ARUBA</option>
<option value="AU">AUSTRALIA</option>
<option value="AT">AUSTRIA</option>
<option value="AZ">AZERBAIJAN</option>
<option value="BS">BAHAMAS</option>
<option value="BH">BAHRAIN</option>
<option value="BD">BANGLADESH</option>
<option value="BB">BARBADOS</option>
<option value="BY">BELARUS</option>
<option value="BE">BELGIUM</option>
<option value="BZ">BELIZE</option>
<option value="BJ">BENIN</option>
<option value="BM">BERMUDA</option>
<option value="BT">BHUTAN</option>
<option value="BO">BOLIVIA</option>
<option value="BA">BOSNIA AND HERZEGOVINA</option>
<option value="BW">BOTSWANA</option>
<option value="BV">BOUVET ISLAND</option>
<option value="BR">BRAZIL</option>
<option value="IO">BRITISH INDIAN OCEAN TERRITORY</option>
<option value="BN">BRUNEI DARUSSALAM</option>
<option value="BG">BULGARIA</option>
<option value="BF">BURKINA FASO</option>
<option value="BI">BURUNDI</option>
<option value="KH">CAMBODIA</option>
<option value="CM">CAMEROON</option>
<option value="CA">CANADA</option>
<option value="CV">CAPE VERDE</option>
<option value="KY">CAYMAN ISLANDS</option>
<option value="CF">CENTRAL AFRICAN REPUBLIC</option>
<option value="TD">CHAD</option>
<option value="CL">CHILE</option>
<option value="CN">CHINA</option>
<option value="CX">CHRISTMAS ISLAND</option>
<option value="CC">COCOS (KEELING) ISLANDS</option>
<option value="CO">COLOMBIA</option>
<option value="KM">COMOROS</option>
<option value="CG">CONGO</option>
<option value="CK">COOK ISLANDS</option>
<option value="CR">COSTA RICA</option>
<option value="CI">COTE D'IVOIRE</option>
<option value="HR">CROATIA</option>
<option value="CU">CUBA</option>
<option value="CY">CYPRUS</option>
<option value="CZ">CZECH REPUBLIC</option>
<option value="DK">DENMARK</option>
<option value="DJ">DJIBOUTI</option>
<option value="DM">DOMINICA</option>
<option value="DO">DOMINICAN REPUBLIC</option>
<option value="EC">ECUADOR</option>
<option value="EG">EGYPT</option>
<option value="SV">EL SALVADOR</option>
<option value="GQ">EQUATORIAL GUINEA</option>
<option value="ER">ERITREA</option>
<option value="EE">ESTONIA</option>
<option value="ET">ETHIOPIA</option>
<option value="FK">FALKLAND ISLANDS (MALVINAS)</option>
<option value="FO">FAROE ISLANDS</option>
<option value="FJ">FIJI</option>
<option value="FI">FINLAND</option>
<option value="FR">FRANCE</option>
<option value="GF">FRENCH GUIANA</option>
<option value="PF">FRENCH POLYNESIA</option>
<option value="TF">FRENCH SOUTHERN TERRITORIES</option>
<option value="GA">GABON</option>
<option value="GM">GAMBIA</option>
<option value="GE">GEORGIA</option>
<option value="DE">GERMANY</option>
<option value="GH">GHANA</option>
<option value="GI">GIBRALTAR</option>
<option value="GR">GREECE</option>
<option value="GL">GREENLAND</option>
<option value="GD">GRENADA</option>
<option value="GP">GUADELOUPE</option>
<option value="GU">GUAM</option>
<option value="GT">GUATEMALA</option>
<option value="GG">GUERNSEY</option>
<option value="GN">GUINEA</option>
<option value="GW">GUINEA-BISSAU</option>
<option value="GY">GUYANA</option>
<option value="HT">HAITI</option>
<option value="VA">HOLY SEE (VATICAN CITY STATE)</option>
<option value="HN">HONDURAS</option>
<option value="HK">HONG KONG</option>
<option value="HU">HUNGARY</option>
<option value="IS">ICELAND</option>
<option value="IN">INDIA</option>
<option value="ID">INDONESIA</option>
<option value="IR">IRAN, ISLAMIC REPUBLIC OF</option>
<option value="IQ">IRAQ</option>
<option value="IE">IRELAND</option>
<option value="IM">ISLE OF MAN</option>
<option value="IL">ISRAEL</option>
<option value="IT">ITALY</option>
<option value="JM">JAMAICA</option>
<option value="JP">JAPAN</option>
<option value="JE">JERSEY</option>
<option value="JO">JORDAN</option>
<option value="KZ">KAZAKHSTAN</option>
<option value="KE">KENYA</option>
<option value="KI">KIRIBATI</option>
<option value="KR">KOREA, REPUBLIC OF</option>
<option value="KW">KUWAIT</option>
<option value="KG">KYRGYZSTAN</option>
<option value="LA">LAO PEOPLE'S DEMOCRATIC REPUBLIC</option>
<option value="LV">LATVIA</option>
<option value="LB">LEBANON</option>
<option value="LS">LESOTHO</option>
<option value="LR">LIBERIA</option>
<option value="LY">LIBYAN ARAB JAMAHIRIYA</option>
<option value="LI">LIECHTENSTEIN</option>
<option value="LT">LITHUANIA</option>
<option value="LU">LUXEMBOURG</option>
<option value="MO">MACAO</option>
<option value="MG">MADAGASCAR</option>
<option value="MW">MALAWI</option>
<option value="MY">MALAYSIA</option>
<option value="MV">MALDIVES</option>
<option value="ML">MALI</option>
<option value="MT">MALTA</option>
<option value="MH">MARSHALL ISLANDS</option>
<option value="MQ">MARTINIQUE</option>
<option value="MR">MAURITANIA</option>
<option value="MU">MAURITIUS</option>
<option value="YT">MAYOTTE</option>
<option value="MX">MEXICO</option>
<option value="FM">MICRONESIA, FEDERATED STATES OF</option>
<option value="MD">MOLDOVA, REPUBLIC OF</option>
<option value="MC">MONACO</option>
<option value="MN">MONGOLIA</option>
<option value="ME">MONTENEGRO</option>
<option value="MS">MONTSERRAT</option>
<option value="MA">MOROCCO</option>
<option value="MZ">MOZAMBIQUE</option>
<option value="MM">MYANMAR</option>
<option value="NA">NAMIBIA</option>
<option value="NR">NAURU</option>
<option value="NP">NEPAL</option>
<option value="NL">NETHERLANDS</option>
<option value="AN">NETHERLANDS ANTILLES</option>
<option value="NC">NEW CALEDONIA</option>
<option value="NZ">NEW ZEALAND</option>
<option value="NI">NICARAGUA</option>
<option value="NE">NIGER</option>
<option value="NG">NIGERIA</option>
<option value="NU">NIUE</option>
<option value="NF">NORFOLK ISLAND</option>
<option value="MP">NORTHERN MARIANA ISLANDS</option>
<option value="NO">NORWAY</option>
<option value="OM">OMAN</option>
<option value="PK">PAKISTAN</option>
<option value="PW">PALAU</option>
<option value="PA">PANAMA</option>
<option value="PG">PAPUA NEW GUINEA</option>
<option value="PY">PARAGUAY</option>
<option value="PE">PERU</option>
<option value="PH">PHILIPPINES</option>
<option value="PN">PITCAIRN</option>
<option value="PL">POLAND</option>
<option value="PT">PORTUGAL</option>
<option value="PR">PUERTO RICO</option>
<option value="QA">QATAR</option>
<option value="RE">REUNION</option>
<option value="RO">ROMANIA</option>
<option value="RU">RUSSIAN FEDERATION</option>
<option value="RW">RWANDA</option>
<option value="SH">SAINT HELENA</option>
<option value="KN">SAINT KITTS AND NEVIS</option>
<option value="LC">SAINT LUCIA</option>
<option value="PM">SAINT PIERRE AND MIQUELON</option>
<option value="VC">SAINT VINCENT AND THE GRENADINES</option>
<option value="WS">SAMOA</option>
<option value="SM">SAN MARINO</option>
<option value="ST">SAO TOME AND PRINCIPE</option>
<option value="SA">SAUDI ARABIA</option>
<option value="SN">SENEGAL</option>
<option value="RS">SERBIA</option>
<option value="SC">SEYCHELLES</option>
<option value="SL">SIERRA LEONE</option>
<option value="SG">SINGAPORE</option>
<option value="SK">SLOVAKIA</option>
<option value="SI">SLOVENIA</option>
<option value="SB">SOLOMON ISLANDS</option>
<option value="SO">SOMALIA</option>
<option value="ZA">SOUTH AFRICA</option>
<option value="ES">SPAIN</option>
<option value="LK">SRI LANKA</option>
<option value="SD">SUDAN</option>
<option value="SR">SURINAME</option>
<option value="SJ">SVALBARD AND JAN MAYEN</option>
<option value="SZ">SWAZILAND</option>
<option value="SE">SWEDEN</option>
<option value="CH">SWITZERLAND</option>
<option value="SY">SYRIAN ARAB REPUBLIC</option>
<option value="TW">TAIWAN, PROVINCE OF CHINA</option>
<option value="TJ">TAJIKISTAN</option>
<option value="TZ">TANZANIA, UNITED REPUBLIC OF</option>
<option value="TH">THAILAND</option>
<option value="TL">TIMOR-LESTE</option>
<option value="TG">TOGO</option>
<option value="TK">TOKELAU</option>
<option value="TO">TONGA</option>
<option value="TT">TRINIDAD AND TOBAGO</option>
<option value="TN">TUNISIA</option>
<option value="TR">TURKEY</option>
<option value="TM">TURKMENISTAN</option>
<option value="TC">TURKS AND CAICOS ISLANDS</option>
<option value="TV">TUVALU</option>
<option value="UG">UGANDA</option>
<option value="UA">UKRAINE</option>
<option value="AE">UNITED ARAB EMIRATES</option>
<option value="GB" selected>UNITED KINGDOM</option>
<option value="US">UNITED STATES</option>
<option value="UY">URUGUAY</option>
<option value="UZ">UZBEKISTAN</option>
<option value="VU">VANUATU</option>
<option value="VE">VENEZUELA</option>
<option value="VN">VIET NAM</option>
<option value="VG">VIRGIN ISLANDS, BRITISH</option>
<option value="VI">VIRGIN ISLANDS, U.S.</option>
<option value="WF">WALLIS AND FUTUNA</option>
<option value="EH">WESTERN SAHARA</option>
<option value="YE">YEMEN</option>
<option value="ZM">ZAMBIA</option>
<option value="ZW">ZIMBABWE</option>


Jason posted this on Friday, June 29, 2007 at 3:34 pm. Leave comment.

Blogmarks button Digg button furl button magnolia button Google Bookmarks button StumbleUpon button Yahoo MyWeb button

Number of comments: 12

Blogger Toby says:

Thanks, a lower case version would be useful too.

Also people may need to use &Aring; (Å) for the Åland islands



This comment was posted on 2:15 pm


Blogger Jason says:

I agree about the lower-case version; the touble is spending the time to go through it manually or create a script to do it.

This comment was posted on 9:11 pm


Blogger koocha says:

Couldn't you use CSS to do it for you? Something along the lines of text-transform:capitalize;

This comment was posted on 10:09 pm


Anonymous Jim Haslip says:

Nice!Thanks and I'll have a look at the UPPER/lower case thing.

This comment was posted on 6:05 am


Anonymous Mea says:

Interesting to know.

This comment was posted on 1:54 pm


Anonymous Anonymous says:

publish E-mail 5. [url=][/url] online casino For more than data on an unbelievably top of the line of reasoning software program from this experts.

This comment was posted on 7:46 am


Anonymous Anonymous says:

However, the rules and laws regarding payday cash advances are different for each of the a couple of countries [url=][/url] payday loans uk The dangers and struggle stress related to the telltale wars encouraged many to be able to drink in order to cope with the psychological injury caused by this kind of physical, emotional and mental trauma

This comment was posted on 4:20 am


Anonymous Anonymous says:

The constant stress of being in the military, viewing fellow challenge buddies cease to live, living with your terror associated with battle, possible sexual attack if woman's, etc [url=][/url] After all, lending products such as car financing or even home loans are difficult to find plus boat lending products can be possibly harder

This comment was posted on 4:20 am


Anonymous Anonymous says:

14%, that's $30 [url=]instant loans uk[/url] Several for-profit schools claim that they are military services friendly and have absolutely recruited experienced persons to enroll

This comment was posted on 4:32 am


Anonymous Anonymous says:

Furthermore, if perhaps brakes squeak as well as vibrate, they will be checked, in spite of mileage [url=]instant payday loans[/url] instant loans Base ones initial resolution of the home's value and financability on all those numbers

This comment was posted on 4:32 am


Anonymous Anonymous says:

We are all part of creation, all noblemen, all poets, most musicians; we now have only to wide open, to discover what exactly is already generally there [url=]instant loans uk[/url] get instant loans This type of loan is also fall under short-term category that you need to pay loan throughout 14-31 days

This comment was posted on 4:33 am


Anonymous Anonymous says:

Some On-line casinos Have got time slot machines for sure multi-spin slots, where you slots, and for one-armed bandit fanatics with very particular preferences, there are all slots casino. [url=]best online casino[/url] online casino If so, iHeart Tuner is soil and now have likewise earned applaud On-line.

This comment was posted on 4:05 am