Form Validation
Checking input and explaining clearly what needs fixing.
See it on the 3D treeGoing deeper
Checks can run in the browser for quick help and must run again on the server, since browser checks can be bypassed. Inline messages after someone leaves a field often work well. Errors should appear beside the field, say how to fix it and not rely on colour alone.
Why it matters
Clear, well-timed checks help people finish instead of guessing what went wrong.
In practice
Instead of "Invalid input", the message reads "Enter a date after today, for example 14 March".
Common mistake
Showing errors while someone is still typing their first attempt.
Connected terms
- Error StateA failed check puts the field into an error state.
- FormValidation is part of how a form works.
- Error PreventionEarly guidance and checks stop bad data before it causes trouble.
- MicrocopyThe wording of messages determines whether people can recover.
- Postel's LawAccept reasonable formats before declaring an entry wrong.