Back to blog

A ZIP code is not a menu

Published

During a recent sign-up flow, I encountered a ZIP-code control implemented as a menu with an option for every possible five-digit value. A control like that asks the browser to create 100,000 choices and asks a person to search a list when they could simply type five characters.

The pathological version

This is what that felt like. Note the delay when you first click into the box. Note that it doesn't work without JavaScript. Note that it's not accessible. Note how absolutely annoying it is to find your own zip code.

ZIP code

If it had been a normal select box, it would have still been terrible, but at least I could have typed with my keyboard, and it would have been somewhat accessible.

How should it work?

It should just be a plain textbox. No JavaScript required. Let the user type their zip code. Accept whatever they type, then parse and validate it on the server. Show an appropriate, clear error message if it isn't valid, and show a summary list at the end of their form submission flow so they can verify and change their answers.