Bruce Lawson’s personal site

Forms: inputting country names

(Last Updated on )

Asking users to tell you which country they live is simple. Devising a method which is both usable and accessible for the user, and which provides good data is not. There are two main problems:

The most accessible, user-friendly way to receive input that a user incontravertibly knows is to ask the user to type their response into a free-text field, rather than require them to select it.

I’m riffing here on an excellent paper called Should I use a drop-down? (warning: PDF) by Sarah Miller and Caroline Jarrett (Jarrett is cited in the second edition of Steve Krug’s Don’t Make Me Think as “the authority on designing Web forms”). In it, they write,

Personal details such as name, address, and date of birth are so well known to us that it is much easier and more natural to type them in directly rather than selecting from a list.

And everybody knows which country they live in (or want to visit, or send a parcel to, or whatever the purpose of your form).

It should be reasonably simple to come up with server-side validation that corrects typos (so “Farnce” is silently corrected to “France” without asking the user. (Some languages have native functions that can do such fuzzy matching). This is more work for the programmer (isn’t that what they’re for?) but takes the work away from the customer, which is A Good Thing.

Nortypig writes,

If we carve it up in other ways like Bruce then we just create more steps which breaks our credo of making this process with a minimum of steps for the user.

But as far as I can see, the only reason to go back to the user is if they’ve typed something absurd, or something ambiguous. For example, if the user has typed “Aus”, you could go back to them with a select box containing “Austria” and “Australia” and ask them to resolve the ambiguity that way. (Extra points if it’s a group of radio buttons for fewer than 5 alternatives, and a select for more than that.)

The last complexity – and where I’m soliciting your help – is to get a look-up table to ensure that synonyms are recognised. Using my example above, if I were running a postcode site, I would like to be able to vaildate that Wales, Scotland, England, Britain, Great Britain, GB, United Kingdom and UK are all the same country, and enter them all in the database as being the same (probably United Kingdom, in this case, but it’s largely arbitrary, as long as reporting software can compare like-with-like).

Can anyone suggest similar groups of synonyms that spring to mind (like United States, USA, America or Bosnia and Herzegovina ) that I can build into my validation routine?

31 Responses to “ Forms: inputting country names ”

Comment by Rich Pedley

I used to think the same about these drop down boxes until someone pointed out to me that once you have navigated to it, you can skip huge portions, by simply choosing a letter via the keyboard. Repeated presses move you onto the next one.

Comment by Gavin Montague

Ulster, Northern Ireland, Ireland, Eire. It could get a bit political.

It’s a great idea but I forsee a problem in some situations. Say that the form is for a postal address for a delivery. If the site is based in England then the parser might be expecting ‘Germany’, but someone in said country might equally type ‘Deutschland’ and be equally correct. Obviously there’s no point in having the French for Germany (whatever that may be) but would the parser have to include all native language renderings of the country name?

Comment by Thijs van der Vossen

Using a long list in a drop down is so widely used and people have gotten so accustomed to this that it will probably take them more time to figure out how they’re supposed to respond when you try to make it ‘easier’ for them.

Comment by Bruce

Thanks for your comments so far, gang.

– Rich: thanks for that tip. I had no idea that’s possible. Is it guaranteed behaviour across all User Agents? It’s certainly very useful for selects with options in alphabetic order, but would still require oodles of leaping about in order to work out which of Great Britain, Britain, England, UK, or United Kingdom is on offer for selecting, so (in my opinion) is not so usable for such countries with lots of synonyms.

– Gavin: I’m not looking (yet) for non-English country names, so Germany is in but Deutschland is out. My fascist reason for this is because I don’t want to have to think about what happens if you try to enter “Japan” in the various Japanese scripts “India” in various different Indian scripts (Hindi, Tamil, Gujerati, Punjabi ..)

– Thijs: I think I disagree with you (but user testing will sort out the hunches from the empirical). I believe that, for something the user absolutely knows, you should accept typed input rather than force them to mouse and select. Everyone knows the country they live in.

Comment by Rich Pedley

I think it does Bruce(work in various UA’s), but I can never think of a site with a complex series of options to test it out when I need to!

One form I do knopw of used to have the common ones at the top, not sure if they were repeated further down the list. Also in theory the options should be grouped, especially afer they go over a certain number – but I’ve never been sure about how useful that really is.

Comment by Bruce

Thanks Andy. Whether something is a synonym or not depends on the app. For the postcode site in my example above, they are synonymous as they all take the same postcode format (and postage within the UK costs the same). If it were a legal site, they wouldn’t be synonymous, as Scotland has different laws from England and Wales.

But we’re off-topic now.

Comment by 456 Berea Street

Selecting country names in forms…

Using select boxes for hundreds of options is not very user friendly, but is there a better way of presenting long lists of options?…

Comment by Paul R. Redmond

I think its dangerous to rely on silently changing mis-spelled words, unless there is some human validation on the user’s part. I like the idea of typing it in instead, so why not do something similar to Google Suggest or It could be coupled with validation similar to, which, if you submit a mis-spelled word it gives you likely suggestions. This would easily narrow it down to a few countries, if not only one possible correct answer.

Comment by Michał Stempień

You can group countries by continents and make two drop downs. Selecting continent in first one loads countries in the second one.

But is it really such a problem to scroll up/down a-z list of 193 names? Please!

Comment by Keith Alexander

Some alternatives to select boxes (in these days of mashups):

give them a map to click on their country. Arguably more fiddly than a select box, and more work for the programmer, but it *would* have some novelty value at least. You could have it default to the country suggested by their IP.

let them type in the input, and when processing the input, look-up wikipedia or something, if there is ambiguity, get the user to choose between the options. AJAX it so they can do it before submitting.

(Have a select menu fall back that you replace with javascript with the fancier options)

Comment by pr10n

This sounds like a good idea for an open source project, if one hasn’t been started already. Another option would be to utilize an IP based geo-location engine. You could preselect the drop down with country provided by the engine. If it is a serious concern to you the $200 for a pre-packaged engine might be reasonable to you. Though I doubt it would of much benefit for a travel destination. Regardless, I have a 130MB text file containing nearly every city, town, village and hamlet on the planet. Email me if you think it might be of use to you.

Comment by Aran

What about this proposal?

1) Use the user’s IP address to show a guessed country name
2) If the user disagrees with the displayed guess, let them click on a link to “change country”
3) After clicking link, use AJAX to display a more traditional drop-down menu.

Comment by Harmen Janssen

Good thinking, these drop-down boxes annoy the hell out of me too, most of the time.

I think Aran’s (comment#18) idea’s not too shabby either (Sitepoint uses it too, for converting the US Dollar prices to your own currency).

Of course, one should never rely on such information because it can easily be faked, but in this situation, since it’s 90% (just a guess) accurate, it could save a few mouse clicks.

Comment by Henrik

Why not make it a text box with auto completion(AJAX). And while you are at it detect the browser language & country based on ip address and present those two as default choices in a radio button list

[X] IP derived Country
[ ] Language derived Country
[ ] ____________________ (Auto complete text box)

Comment by juaron

How about combining it all:
In your backend, you could assign synonyms for every country in your list, and put them all in a dropdown list (so you get America, Belgium, Congo, …, Tanzania, United States, Zimbabwe). The list is selects the country it thinks you’re in based on your ip.
When you’ve got javascript enabled, the dropdown is replaced Henriks solution.This way, you serve both users with and without javascript…
The only problem is that screenreader users will always get the huge dropdownlist.

Comment by Bruce

.. and there’s the rub, juaron; screenreader-users are the people who are least equipped to deal with the huge dropdown list.

Mind you, Henrik’s idea is pretty damn neat. Would be good to do formal usability studies to see if the reading the extra stuff on the screen (IP-derived country, language-derived country [if different]) didn’t take longer than actually typing the first few letters of your country into a standalone textbox without the suggestions.

Comment by Eric Caron

I second the suggestion that Google Suggest’s style box would be the best solution for this ( It would only be AJAX-based because you could quickly store the listing of all countries (and versions) in a short-quickly loaded text file. That way they would type, but you’d still force them to select from the menu and you’d get around having to deal with typos. It also wouldn’t be as system-intensive as some Suggest-style php/mysql solution since you have a very limited data set.

I don’t think the IP-based solution will work at all with people using more anonymous proxies every day.

Comment by Sylvain Vachon

I work as a lead user interface developper in a banking website for which I developped a solution for the selection of country names. The first usage for this selector is for wire funds transfers, but now, we use it everywhere in the website.

Here’s the deal:

– give a dropdown to users with their 10 most used countries in transactions or operations in the site (by the way, you can use a cookie to keep those “prefered” countries)
– have a “link” in the dropdown to extend the choices to all ISO-3166 countries with a simulated dropdown loaded with an AJAX call
– the list of ISO-3166 countries is navigable with a rollodex-like interface
– in the list of those countries, we included synonyms and references to official ISO country names (ex: Yougoslavia refers to Serbia And Montenegro)

Users like to country selector. After only a few use, you get the countries you use directly in the small dropdown. For the rare occasions you have to select another country, there’s the list available with a simple interface and neat help from references and synonyms pointing you to the official names (as a banking website, you have to be careful with country name synonyms or references, you cannot have a political edge!)

I’m working on accessibility for the selector. It should work without the AJAX and Javascript stuff.

Comment by pietertje

Also Holland and the Netherlands are not the same:
But Holland is always in the Netherlands so you can change it silently.
But i find this topic very interesting since i’m working on the new website of hospitalityclub where a lot of information is about where you’re located.
This website is in about 30-40 languages and with the different names for 1 country it is really hard to do it this way. But i think we should consider making a user driven database with country info.

and pr10n your email address is not there, so i can’t email you… my mail is: pietertje – at – mail [ dot ] com

Comment by simon r jones

I remember reading something about this in Joe Clark’s accessibility book – amazing really that the problem is still with us.

I agree Henrik’s idea of some suggested defaults is excellent. Browser language doesn’t necessarily tell you where someone is however, just what they want to read a website in (though it’s a good guess of course).

IP lookups are from what I hear pretty reliable, but it may be considered overkill The additional server work may create an unacceptable lag. And maintaining a large list of IP addresses may be too much work for the average app.

Before reading this article my thoughts were let users enter the country in a simple text field. Get the server to match the name to a country, if there’s a match hurrah. If not, try to use soundex to catch similar words (i.e. soundex would match Farnce to France). The user can then be asked to confirm their choice, certainly useful if a few options are returned.

Synonyms are an interesting point. I understand what Sylvain says about being careful how you name things. In E-Commerce apps we’ve designed I’ve always used the standard ISO-3166 list of countries in a hope to keep things standard. This is also usually required to synch your country data with any payment provider you may use to process card payments.

So I guess synonyms would have to be used on a case-by-case basis.

Comment by John D

input type=”text” for me.

I’m not getting involved with my users’ decisions on whether it’s United Kingdom vs. Great Britain vs. the United Kingdom of Great Britain & Northern Ireland, USA vs. EEUU, how to spell Kampuchea vs. Cambodia, or the People’s Democratic/Socialist/Nihilist Republic of ____.

And I’m definitely not making screen readers wade through the United Nations roll call.

Unless you’re in the situation where you’ve got to branch off of the proper spelling of that and validate the postal code in accord with the laws of the sovereign nation in question, and I hope none of you ever are, why bother?

We don’t even do it with states here in the US, because there are still fifty of them, plus territories. That’s extra code you don’t need, and it’s still a slog with JAWS, Window-Eyes, or any other reader.

For that matter, what’s up with the $1000 price tag on said screen reader? Until Freedom Scientific or the others put that in a price range we can afford, say hello to us putting the alt tags and every other small thing just to satisfy Priority 1, and not even trying to simulate the JAWS/Window-Eyes/? experience.

Taking it from the top: Link, Home. Link, About. Link, …

Comment by zylstra

“I used to think the same about these drop down boxes until someone pointed out to me that once you have navigated to it, you can skip huge portions, by simply choosing a letter via the keyboard. Repeated presses move you onto the next one.”

Yeah, but the idea is that the form is supposed to be designed for people who are not familiar with browsers. No offense, but what business do you guys have writing about and commenting on UI if you don’t even know that? Hmmm…

Leave a Reply

HTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> . To display code, manually escape it.