
The Patterns 389
Even better, some web forms put error messages physically next to the controls where the
errors were made. Now the user can see at a glance where the problems were—no need to
hunt down the offending field based just on its name—and the instructions for fixing it
are right there, easily visible.
How
First, design the form to prevent certain kinds of errors. Use drop downs instead of open
text fields, if the choices are limited and not easy to type. For text fields, offer
Input Hints,
Input Prompts, Forgiving Format, Autocompletion, and Good Defaults to support text entry.
Clearly mark all the required fields as required (with asterisks), and don’t ask for too many
required fields in the first place.
When errors do happen, you should show some kind of error message on top of the form,
even if you put the detailed messages next to the controls. The top is the first thing people
see. (It’s also good for visually impaired users—the top of the form is read to them first,
so they know immediately that the form has an error.) Put an attention-getting graphic
there, and use text that’s stronger than the body text: make it red and bold, for instance.
Now mark the form fields that caused the errors. Put specific messages next to them, if
you can—this will require extra space beside, above, or below the fields—but at the least,
use color and/or a small graphic to mark the field, as shown in Figure 8-35.Users com-
monly associate red with errors in this context. Use it freely, but since so many people are
colorblind with respect to red, use other cues, too: language, bold text (not huge), and
graphics.
If you’re designing for the Web or some other client/server system, try to do as much vali-
dation as you can on the client side. It’s much quicker. Put the error messages on the page
that’s already loaded, if possible, to avoid a page-load wait.
A tutorial on error-message writing is beyond the scope of this pattern, but here are some
quick guidelines:
• Make them short, but detailed enough to explain both which field it is and what went
wrong: “You haven’t given us your address” versus “Not enough information.”
• Use ordinary language, not computerese: “Is that a letter in your zip code?” versus
“Numeric validation error.”
• Be polite: “Sorry, but something went wrong! Please click ‘Go’ again” versus “JavaScript
Error 693” or “This form contains no data.”
Examples
Twitter’s and Mint’s registration pages (Figures 8-36 and 8-37, respectively) show either
an error message or an “OK” message. This can help for short forms.