How Do I
Validate submissions
Make validation clear, friendly, and enforced on the server.
Validation always belongs to the backend.
The client can mirror the same constraints for better UX, but the backend must still reject invalid payloads and return user-friendly messages.
Good practices
- Translate validation messages.
- Match each message to the actual failing rule.
- Keep required-field errors specific.
- Mirror frontend hints without treating them as security boundaries.
If a field is required and the user leaves it empty, return a message that explains what is missing instead of a generic technical error.