country select list

R

Rob McAninch

dorayme>:
Good point. it is helpful mostly to those who want to lie about
their country and can't spell...

Of course if I want to lie about my country I'll just modify the
form. Or use the drop down list and choose an entirely bogus answer.

About the only time I can see a valid reason for asking someone to
choose a country is to either give them a map, directions, or ship
them something. In any of these cases you will be validating against
a known data set.

Better to let them use a text box for efficiency.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed "Leszek" <leszekt80
@poczta.onet.pl> writing in
Hi.
Is it possible to make a select lst of all countries in the world?
Is there a list of countries i could download and place it in my form?

thanx
Leszek

I use the ISO country codes in my database, and pull the country
name/codes from there <http://www.iso.org/iso/en/prods-
services/iso3166ma/02iso-3166-code-lists/list-en1.html>.

In addition to what others have said, if you are going to make a drop
down list of countries, and your users are usually in a specific country
(ie American Loyalty Card), then have that country as the first choice.

<select name="country">
<option value="">Select Country</option>
<option value="255">United States</option>
<!-- loop through the database here -->
</select>

You can also do some best guessing looking at the HTTP_ACCEPT_LANGUAGE.
That's what Google does in determining which interface to serve. For
instance, if your accept language is French, Google will serve pages in
French. Mind you, it's definately not fool proof.
 
J

Jukka K. Korpela

Adrienne Boswell said:
In addition to what others have said, if you are going to make a drop
down list of countries, and your users are usually in a specific country
(ie American Loyalty Card), then have that country as the first choice.

While that may sound natural, and may actually help at times, it will also
mislead people. If you take a quick look at a dropped-down menu, you probably
see that it's in alphabetic order, which is a natural expectation anyway.
Then you might be looking for United States somewhere between the Ukraine and
Uruguay, in vain.
You can also do some best guessing looking at the HTTP_ACCEPT_LANGUAGE.

That would be foolish, really.
That's what Google does in determining which interface to serve.

Google is known for its obscure, undocumented, and harmful trickery in
choosing the interface language according to various data.
For instance, if your accept language is French, Google will serve pages in
French. Mind you, it's definately not fool proof.

If only it did so (consistently), things would be better. The Accept-Language
header (that's it's name; the CGI interface transmogrifies it into
HTTP_ACCEPT_LANGUAGE) is meant exactly for that: for expressing the user's
linguistic preferences, for use when the server has the same content
available in two or more languages. Confusing it with country selection is
the start of infinite confusion and frustration. The question was about
country selection.
 
J

Jose

Then you might be looking for United States somewhere between the Ukraine and
Uruguay, in vain.

It would be there, in addition.
Google is known for its obscure, undocumented, and harmful trickery in
choosing the interface language according to various data.

It is not known to me for this. Enlighten me.

Jose
 
J

Jukka K. Korpela

Jose said:
It would be there, in addition.

Would it? That was not mentioned. Anyway, such a setting would create a
different problem: the user might ask why a country appears several times and
what the difference is. Besides, it would make the large list even larger.
It is not known to me for this. Enlighten me.

Oh, it has been discussed at length on different fora. I don't know of any
summary page, and it would be difficult to compose one, since Google keeps
changing.
 
J

Jose

Would it? That was not mentioned.

It would be sensible.
Besides, it would make the large list even larger.

By a few entries. More than three duplicated at the top would be too
many to be useful anyway, and for a small list, there'd be no need.
Oh, [google's harmful trickery] has been discussed at length on different fora.

Ok. I'm convinced.

Jose
 
A

Adrienne Boswell

While that may sound natural, and may actually help at times, it will
also mislead people. If you take a quick look at a dropped-down menu,
you probably see that it's in alphabetic order, which is a natural
expectation anyway. Then you might be looking for United States
somewhere between the Ukraine and Uruguay, in vain.

It is duplicated. In the case of the US, it is duplicated once. I would
not do that for a country that had a lot of choices, as was discussed
futher up in this thread.
That would be foolish, really.


Google is known for its obscure, undocumented, and harmful trickery in
choosing the interface language according to various data.


If only it did so (consistently), things would be better. The
Accept-Language header (that's it's name; the CGI interface
transmogrifies it into HTTP_ACCEPT_LANGUAGE) is meant exactly for that:
for expressing the user's linguistic preferences, for use when the
server has the same content available in two or more languages.
Confusing it with country selection is the start of infinite confusion
and frustration. The question was about country selection.

You are absolutely correct. In fact, for a site I am working on, when it
goes international, I will be removing US as the first choice on the list.
But that won't be for some time, however, I'm making a note in my calendar
that I need to do this.
 
A

Andrew Donaldson

Rob said:
I question the usefulness of such drop down lists. Most people know
what country they live in and can type it much faster than scrolling
a list (or typing to get the list closer to the choice you need).

Further to this and the other problems outlined in this thread:

Today I received (in the UK) a parcel which was posted in the UK. The
parcel has arrived via the United States, complete with customs declaration.

Why? Because the last line of my address on the parcel reads "United
States" (even though the rest of the address was correct.) The item in
the parcel was ordered via a website. I had to choose the country from a
select list.

Now I think the mistake is almost entirely mine. I may have clicked on
the wrong item in the list. More likely, I scrolled the select box with
my mouse wheel when attempting to scroll the web page. I do that a lot.
I could also have checked the details more carefully before final
submission.

But I do know for absolute sure that I would not have made that mistake
if I had to type in the country myself!

Andrew
 
D

Daniel Schierbeck

Leszek said:
Hi.
Is it possible to make a select lst of all countries in the world?
Is there a list of countries i could download and place it in my form?

thanx
Leszek

Here's an XML file containing a list of all the countries in the world,
plus the two-letter abbreviation.

<country abbr="DK">Denmark</country>


Cheers and happy holidays
Daniel Schierbeck
 
D

Daniel Schierbeck

Daniel said:
Here's an XML file containing a list of all the countries in the world,
plus the two-letter abbreviation.

<country abbr="DK">Denmark</country>


Cheers and happy holidays
Daniel Schierbeck


------------------------------------------------------------------------

<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/css" href="countrylist.css"?>
<country-list xmlns="" xml:lang="en">
<country abbr="AF">Afghanistan</country>
<country abbr="AL">Albania</country>
<country abbr="DZ">Algeria</country>
<country abbr="AS">American Samoa</country>
<country abbr="AD">Andorra</country>
<country abbr="AO">Angola</country>
<country abbr="AI">Anguilla</country>
<country abbr="AQ">Antarctica</country>
<country abbr="AG">Antigua and Barbuda</country>
<country abbr="AR">Argentina</country>
<country abbr="AM">Armenia</country>
<country abbr="AW">Aruba</country>
<country abbr="AU">Australia</country>
<country abbr="AT">Austria</country>
<country abbr="AZ">Azerbaijan</country>
<country abbr="BS">Bahamas</country>
<country abbr="BH">Bahrain</country>
<country abbr="BD">Bangladesh</country>
<country abbr="BB">Barbados</country>
<country abbr="BY">Belarus</country>
<country abbr="BE">Belgium</country>
<country abbr="BZ">Belize</country>
<country abbr="BJ">Benin</country>
<country abbr="BM">Bermuda</country>
<country abbr="BT">Bhutan</country>
<country abbr="BO">Bolivia</country>
<country abbr="BA">Bosnia and Herzegowina</country>
<country abbr="BW">Botswana</country>
<country abbr="BV">Bouvet Island</country>
<country abbr="BR">Brazil</country>
<country abbr="IO">British Indian Ocean Territory</country>
<country abbr="BN">Brunei Darussalam</country>
<country abbr="BG">Bulgaria</country>
<country abbr="BF">Burkina Faso</country>
<country abbr="BI">Burundi</country>
<country abbr="KH">Cambodia</country>
<country abbr="CM">Cameroon</country>
<country abbr="CA">Canada</country>
<country abbr="CV">Cape Verde</country>
<country abbr="KY">Cayman Islands</country>
<country abbr="CF">Central African Republic</country>
<country abbr="TD">Chad</country>
<country abbr="CL">Chile</country>
<country abbr="CN">China</country>
<country abbr="CX">Christmas Island</country>
<country abbr="CC">Cocos (Keeling) Islands</country>
<country abbr="CO">Colombia</country>
<country abbr="KM">Comoros</country>
<country abbr="CG">Congo</country>
<country abbr="CD">Congo, the Democratic Republic of the</country>
<country abbr="CK">Cook Islands</country>
<country abbr="CR">Costa Rica</country>
<country abbr="CI">Cote d’Ivoire</country>
<country abbr="HR">Croatia (Hrvatska)</country>
<country abbr="CU">Cuba</country>
<country abbr="CY">Cyprus</country>
<country abbr="CZ">Czech Republic</country>
<country abbr="DK">Denmark</country>
<country abbr="DJ">Djibouti</country>
<country abbr="DM">Dominica</country>
<country abbr="DO">Dominican Republic</country>
<country abbr="TP">East Timor</country>
<country abbr="EC">Ecuador</country>
<country abbr="EG">Egypt</country>
<country abbr="SV">El Salvador</country>
<country abbr="GQ">Equatorial Guinea</country>
<country abbr="ER">Eritrea</country>
<country abbr="EE">Estonia</country>
<country abbr="ET">Ethiopia</country>
<country abbr="FK">Falkland Islands (Malvinas)</country>
<country abbr="FO">Faroe Islands</country>
<country abbr="FJ">Fiji</country>
<country abbr="FI">Finland</country>
<country abbr="FR">France</country>
<country abbr="FX">France, Metropolitan</country>
<country abbr="GF">French Guiana</country>
<country abbr="PF">French Polynesia</country>
<country abbr="TF">French Southern Territories</country>
<country abbr="GA">Gabon</country>
<country abbr="GM">Gambia</country>
<country abbr="GE">Georgia</country>
<country abbr="DE">Germany</country>
<country abbr="GH">Ghana</country>
<country abbr="GI">Gibraltar</country>
<country abbr="GR">Greece</country>
<country abbr="GL">Greenland</country>
<country abbr="GD">Grenada</country>
<country abbr="GP">Guadeloupe</country>
<country abbr="GU">Guam</country>
<country abbr="GT">Guatemala</country>
<country abbr="GN">Guinea</country>
<country abbr="GW">Guinea-Bissau</country>
<country abbr="GY">Guyana</country>
<country abbr="HT">Haiti</country>
<country abbr="HM">Heard and Mc Donald Islands</country>
<country abbr="VA">Holy See (Vatican City State)</country>
<country abbr="HN">Honduras</country>
<country abbr="HK">Hong Kong</country>
<country abbr="HU">Hungary</country>
<country abbr="IS">Iceland</country>
<country abbr="IN">India</country>
<country abbr="ID">Indonesia</country>
<country abbr="IR">Iran (Islamic Republic of)</country>
<country abbr="IQ">Iraq</country>
<country abbr="IE">Ireland</country>
<country abbr="IL">Israel</country>
<country abbr="IT">Italy</country>
<country abbr="JM">Jamaica</country>
<country abbr="JP">Japan</country>
<country abbr="JO">Jordan</country>
<country abbr="KZ">Kazakhstan</country>
<country abbr="KE">Kenya</country>
<country abbr="KI">Kiribati</country>
<country abbr="KP">Korea, Democratic People’s Republic of</country>
<country abbr="KR">Korea, Republic of</country>
<country abbr="KW">Kuwait</country>
<country abbr="KG">Kyrgyzstan</country>
<country abbr="LA">Lao People’s Democratic Republic</country>
<country abbr="LV">Latvia</country>
<country abbr="LB">Lebanon</country>
<country abbr="LS">Lesotho</country>
<country abbr="LR">Liberia</country>
<country abbr="LY">Libyan Arab Jamahiriya</country>
<country abbr="LI">Liechtenstein</country>
<country abbr="LT">Lithuania</country>
<country abbr="LU">Luxembourg</country>
<country abbr="MO">Macau</country>
<country abbr="MK">Macedonia, The Former Yugoslav Republic of</country>
<country abbr="MG">Madagascar</country>
<country abbr="MW">Malawi</country>
<country abbr="MY">Malaysia</country>
<country abbr="MV">Maldives</country>
<country abbr="ML">Mali</country>
<country abbr="MT">Malta</country>
<country abbr="MH">Marshall Islands</country>
<country abbr="MQ">Martinique</country>
<country abbr="MR">Mauritania</country>
<country abbr="MU">Mauritius</country>
<country abbr="YT">Mayotte</country>
<country abbr="MX">Mexico</country>
<country abbr="FM">Micronesia, Federated States of</country>
<country abbr="MD">Moldova, Republic of</country>
<country abbr="MC">Monaco</country>
<country abbr="MN">Mongolia</country>
<country abbr="MS">Montserrat</country>
<country abbr="MA">Morocco</country>
<country abbr="MZ">Mozambique</country>
<country abbr="MM">Myanmar</country>
<country abbr="NA">Namibia</country>
<country abbr="NR">Nauru</country>
<country abbr="NP">Nepal</country>
<country abbr="NL">Netherlands</country>
<country abbr="AN">Netherlands Antilles</country>
<country abbr="NC">New Caledonia</country>
<country abbr="NZ">New Zealand</country>
<country abbr="NI">Nicaragua</country>
<country abbr="NE">*****</country>
<country abbr="NG">Nigeria</country>
<country abbr="NU">Niue</country>
<country abbr="NF">Norfolk Island</country>
<country abbr="MP">Northern Mariana Islands</country>
<country abbr="NO">Norway</country>
<country abbr="OM">Oman</country>
<country abbr="PK">Pakistan</country>
<country abbr="PW">Palau</country>
<country abbr="PA">Panama</country>
<country abbr="PG">Papua New Guinea</country>
<country abbr="PY">Paraguay</country>
<country abbr="PE">Peru</country>
<country abbr="PH">Philippines</country>
<country abbr="PN">Pitcairn</country>
<country abbr="PL">Poland</country>
<country abbr="PT">Portugal</country>
<country abbr="PR">Puerto Rico</country>
<country abbr="QA">Qatar</country>
<country abbr="RE">Reunion</country>
<country abbr="RO">Romania</country>
<country abbr="RU">Russian Federation</country>
<country abbr="RW">Rwanda</country>
<country abbr="KN">Saint Kitts and Nevis</country>
<country abbr="LC">Saint LUCIA</country>
<country abbr="VC">Saint Vincent and the Grenadines</country>
<country abbr="WS">Samoa</country>
<country abbr="SM">San Marino</country>
<country abbr="ST">Sao Tome and Principe</country>
<country abbr="SA">Saudi Arabia</country>
<country abbr="SN">Senegal</country>
<country abbr="SC">Seychelles</country>
<country abbr="SL">Sierra Leone</country>
<country abbr="SG">Singapore</country>
<country abbr="SK">Slovakia (Slovak Republic)</country>
<country abbr="SI">Slovenia</country>
<country abbr="SB">Solomon Islands</country>
<country abbr="SO">Somalia</country>
<country abbr="ZA">South Africa</country>
<country abbr="GS">South Georgia and the South Sandwich Islands</country>
<country abbr="ES">Spain</country>
<country abbr="LK">Sri Lanka</country>
<country abbr="SH">St. Helena</country>
<country abbr="PM">St. Pierre and Miquelon</country>
<country abbr="SD">Sudan</country>
<country abbr="SR">Suriname</country>
<country abbr="SJ">Svalbard and Jan Mayen Islands</country>
<country abbr="SZ">Swaziland</country>
<country abbr="SE">Sweden</country>
<country abbr="CH">Switzerland</country>
<country abbr="SY">Syrian Arab Republic</country>
<country abbr="TW">Taiwan, Province of China</country>
<country abbr="TJ">Tajikistan</country>
<country abbr="TZ">Tanzania, United Republic of</country>
<country abbr="TH">Thailand</country>
<country abbr="TG">Togo</country>
<country abbr="TK">Tokelau</country>
<country abbr="TO">Tonga</country>
<country abbr="TT">Trinidad and Tobago</country>
<country abbr="TN">Tunisia</country>
<country abbr="TR">Turkey</country>
<country abbr="TM">Turkmenistan</country>
<country abbr="TC">Turks and Caicos Islands</country>
<country abbr="TV">Tuvalu</country>
<country abbr="UG">Uganda</country>
<country abbr="UA">Ukraine</country>
<country abbr="AE">United Arab Emirates</country>
<country abbr="GB">United Kingdom</country>
<country abbr="US">United States</country>
<country abbr="UM">United States Minor Outlying Islands</country>
<country abbr="UY">Uruguay</country>
<country abbr="UZ">Uzbekistan</country>
<country abbr="VU">Vanuatu</country>
<country abbr="VE">Venezuela</country>
<country abbr="VN">Viet Nam</country>
<country abbr="VG">Virgin Islands (British)</country>
<country abbr="VI">Virgin Islands (U.S.)</country>
<country abbr="WF">Wallis and Futuna Islands</country>
<country abbr="EH">Western Sahara</country>
<country abbr="YE">Yemen</country>
<country abbr="YU">Yugoslavia</country>
<country abbr="ZM">Zambia</country>
<country abbr="ZW">Zimbabwe</country>
</country-list>

Two things.

1. Just remove the stylesheet PI, I forgot to do it before I sent the
XML file to you.

2. You can use XSLT to transform the document into XHTML.


Cheers,
Daniel
 
Joined
Jul 31, 2010
Messages
1
Reaction score
0
You can use a free tool that i've created:

jota-webdesign.com/index.php?option=com_selectool&Itemid=19

You can change the label and value values. It has 246 countries according to ISO 3166-1

:D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top