Saturday, November 28, 2009

Ban the drop-down.

A drop-down control on your website tells me two very bad things about your mindset.

Let's use an address entry section of an order form as an example. Using a drop-down for state is nearly universal. Here are two very bad things:

1. You think I am so stupid that I don't know what the hell state I am in--that I need a reminder or can't remember how to spell it. Or worse--the two-digit postal abbreviation.

2. Your business logic is so stupid that you don't know how to deal with people who really ARE that stupid or make a simple error (for instance, I might type "Wahsington" because I'm in a hurry).

Either may be true or both. It doesn't matter--it's a horrid thing, because I'm sitting here typing-and-tabbing from field to field. And now you want my state code, and you make me choose from a list of fifty-one OR MORE items.

Rethink how you do this, people. There are two very easy-to-do things in this day and age and one not-so-easy to do thing:

1. Dispense with state entry altogether. Ask for city and postal code. Ask for country as well, if your application is used by people outside the USA. This has the benefit of automatically telling you what state they are in. As well, it is easy to localize, as EVERY COUNTRY'S postal system assigns different codes for areas in two different subnational units, no matter how close together the areas are. That is to say, you can tell Kansas City, KS from Kansas City, MO by the postal code.

The data you need for this with respect to American addresses is freely available from both the Census Bureau and USPS. In Canada, both are available from Canada Post and Statistics Canada. They put this stuff on their websites in reasonably-accessible formats for you to download. USE IT.

BY THE WAY, if you have them enter their country--FOR THE LOVE OF GOD DO IT THE SAME WAY. While searching for through a list of 51 states is annoying, searching through a list of 220 countries is REALLY ANNOYING.

2. There are "did-you-mean" libraries available for every mainstream web programming language--Java, Python, Ruby, Perl, and PHP. Perfectly OK to present an error message in some way saying "hey, did you mean...Washington instead of Wahsington?"

3. Now for the not-so-easy to do thing: Allow someone to type a free-form address in one field. Be bold, Google Maps does it. This could require some effort and/or use of a third-party address validation service (Google might be willing to let you borrow their code via a web service in fact). People actually LIKE this interface, especially from mobile devices. Consider using it.

This is 2009, people. Let's get with the program.