Forms & Validation Standard
Form structure, field standards by type, required markers, validation timing, error display, Add/Edit consistency, phone E.164, file MIME.
Actual UI Examples
For frontend work, the standard should be visible in the UI itself. Use actual field patterns like these instead of treating the guidance as code-only notes.
Create Form Example
Error + Loading State Example
Password must be at least 8 characters.
Form-Level Error
A project with this name already exists.
1. Form Structure
2. Field Standards
Text Inputs
Date Fields
Select / Dropdown
Checkboxes & Radio
Textarea
Rich Text Editor
3. Required Fields
4. Validation Timing
On Submit
On Blur (after user leaves a field)
Never
5. Error Display
Field Errors
Form-Level Errors (API errors that don't map to a field)
Error Message Standards
| Situation | Example Message |
|---|---|
| Required field empty | "[Field] is required." |
| Email invalid | "Enter a valid email address." |
| Password too short | "Password must be at least 8 characters." |
| Passwords don't match | "Passwords do not match." |
| Name too long | "[Field] must be 100 characters or fewer." |
| Duplicate value | "A project with this name already exists." |
| API failure | "Something went wrong. Please try again." |
6. Add/Edit Consistency
This is a non-negotiable. Add and Edit for the same entity must be identical in every dimension: