0
Forms & Validation · Validation
New technique
Two gates, two jobs
Check input twice: in the browser for speed, and on the server for safety. Only the server check can't be skipped.
Client-side validation runs in the browser: instant feedback, fewer round trips. Good for the user.
But anyone can switch it off, edit the HTML in devtools, or send a request without your page at all. So the server must always check everything again.
- Client: validate for speed and comfort.
- Server: validate for trust and security. Never skip it.