Validation Rules
Validation ensures respondents provide data in the correct format before submitting. Set rules on individual fields: required, min/max length, patterns, and custom error messages.
Setting validation
- Click any field on the canvas
- Open the Validation section in the right panel
- Add rules
Common validation rules
Required
Toggle Required on to prevent submission without this field. A red asterisk (*) appears next to the field label.
Text validation
| Rule | Description | Example |
|---|---|---|
| Min length | Minimum characters | Min 2 for names |
| Max length | Maximum characters | Max 500 for messages |
| Pattern (regex) | Must match a regular expression | Email format, phone format |
| Exact match | Must equal a specific value | Confirmation fields |
Number validation
| Rule | Description |
|---|---|
| Min value | Number must be at least this value |
| Max value | Number must not exceed this value |
| Integer only | No decimal values |
| Step | Must be a multiple of this value (e.g., step 5: only 5, 10, 15...) |
Date validation
| Rule | Description |
|---|---|
| Not in past | Only future dates |
| Not in future | Only past or present dates |
| After date | Must be after a specific date |
| Before date | Must be before a specific date |
File upload validation
| Rule | Description |
|---|---|
| Allowed types | Restrict file types (e.g., PDF only, images only) |
| Max file size | Maximum size per file (e.g., 10MB) |
| Max files | Maximum number of files |
Custom error messages
Each validation rule has a default error message. Override it for a better user experience:
| Default | Custom |
|---|---|
| "This field is required" | "Please enter your email address" |
| "Value is too short" | "Company name must be at least 2 characters" |
| "Invalid format" | "Please enter a valid US phone number (e.g., 555-123-4567)" |
Set custom messages in the Error message field below each validation rule.
Cross-field validation
Validate fields against each other:
| Rule | Configuration |
|---|---|
| End date after start date | End date: "After" → reference Start date field |
| Confirm email matches | Confirm email: "Exact match" → reference Email field |
| Max total quantity | Calculated field that sums quantities, validated to be under a max |
Validation timing
| When | Behavior |
|---|---|
| On blur | Validates when the user clicks away from the field. Default behavior. |
| On submit | Validates only when the submit button is clicked. All errors shown at once. |
| Real-time | Validates as the user types (for pattern matching). Shows a checkmark when valid. |
Configure per-field in Validation → Trigger.
Visual feedback
When validation fails:
- The field border turns red
- The error message appears below the field in red text
- The form cannot be submitted until all errors are resolved
- A summary of errors appears at the top of the form (if multiple errors)
When validation passes:
- The field border returns to default
- A green checkmark appears (if real-time validation is enabled)
Common validation patterns
| Field | Rules |
|---|---|
| Required + pattern (email format) | |
| Phone | Pattern (phone format for target country) |
| Password | Min 8 chars + pattern (at least 1 uppercase, 1 number) |
| URL | Pattern (starts with http:// or https://) |
| Zip code | Pattern (5 digits or ZIP+4 format) |
| Age | Required + min 18 + max 120 |
Write custom error messages that tell the user what to do, not just what went wrong. "Please enter a valid email address (e.g., name@company.com)" is more helpful than "Invalid format."
Validation is client-side for instant feedback, but all rules are also enforced server-side. Users cannot bypass validation by modifying the browser.