Reference
What is Form validation?
Form validation checks that input is acceptable before it is processed. Client-side validation is a convenience that improves the experience and catches typos early; server-side validation is the actual security control, because anything sent from a browser can be modified before it arrives.
Also called: client-side validation · server-side validation
The rule
Validate on the client for speed and helpfulness. Validate on the server for correctness and security. A form that only validates in the browser is not validated at all — it is decorated.
What good error handling looks like
- Errors shown next to the field, in text, not only as a colour change
- The message says what to do, not that something is invalid
- No layout shift when the message appears, so the button does not move under a thumb
- Entered data preserved on error — losing a completed form is how enquiries are lost
- Errors announced to assistive technology via a live region
The mobile detail that costs conversions
Correct input types and autocomplete attributes, so the right keyboard appears and the browser can fill the form in one tap. It is a few attributes and it measurably changes completion rates.
Where this is covered in depth
A definition can only go so far. Why checkouts get abandoned, and which fixes belong in the build covers this properly — 2 minutes, free, no email required.
Who wrote this
Anas Bin Masud builds e-commerce sites and does technical SEO for businesses in the UK, Canada and Pakistan. These definitions come from client work rather than from a content brief — where an entry describes a mistake, it is usually one found on a real site. More about how I work.