How do you prevent errors in web forms before they happen?
Keep the field name visible even after it is filled, show character limits, block the wrong data type in a field, make fields case insensitive where possible, fill sensible defaults, validate complex fields like passwords in real time and keep the button inactive until required fields are complete. Prevention beats a good error message. These are the error prevention checks in my UX audit template.
Prevention is cheaper than recovery
Every error a user hits is a chance to leave. My UX audit template separates error prevention from error recovery, because the best error message is the one nobody sees.
The checks
- High: complex fields such as password or username are validated in real time
- Medium: the error message points to the field with the problem
- Medium: the name of the field is always visible, including when it is filled
- Medium: in forms with two or more fields, the button stays inactive until all required fields are filled
- Medium: fields are not case sensitive where that makes sense, such as email
- Medium: users can see the character limit for a field
- Medium: users can preview changes if reverting them takes a long time
- Medium: fields contain default values where applicable
- Medium: the wrong data type is blocked, such as numbers in a name field
- Medium: a field is checked when the entry is complete, not while typing and not only when the button is pressed
Pair it with good form design
From the fields and forms category of the same template: put fields in one column, keep the number of fields minimal, leave enough space between them, make field size match the expected input, and let users pick dates and addresses rather than type them.
The placeholder trap
Placeholders that disappear when the user starts typing are a common source of errors. The user forgets what the field asked for. That is why the template checks that the field name stays visible.
How to test
Fill your form badly on purpose: wrong formats, missing fields, capital letters in the email, a pasted phone number with spaces. Every time the form accepts junk or rejects something reasonable, you have found a fix.