Validation

Every Form Kit field validates input before the form submits. Configure rules directly in the Properties Panel — no code, no guesswork.

How validation works

  1. Select any Form Kit field on your canvas
  2. Open the Properties Panel (right sidebar)
  3. Toggle Required, set length limits, or pick a format rule
  4. Write custom error messages that match your project's voice
  5. Preview — errors appear in real-time when users leave the field
Validation runs on blur (when the user tabs or clicks away). The Submit button also validates all fields before allowing submission.

Validation by field type

Each field type uses rules that make sense for its data. Text fields check character length, number fields check value ranges, and so on.

Field TypeAvailable RulesNotes
Text, Textarea, Passwordrequired, minLength, maxLength, pattern (regex)Choose built-in (min/max) OR regex — they're mutually exclusive
Emailrequired, email formatBuilt-in format check, no regex needed
Phonerequired, phone formatAccepts digits, spaces, dashes, parentheses, +
URLrequired, URL formatMust include protocol (https://)
Numberrequired, min, maxValidates value range, not character length
Checkbox, TogglerequiredRequired means "must be checked"
Checkbox Grouprequired, minSelected, maxSelectedEnforces selection count range
Select, Radio, Button GrouprequiredRequired means "must select an option"
Ratingrequired0 = no selection (required works correctly)
NPSrequired0 = no selection
Slidermin, maxNo "required" — slider always has a value
File, Imagerequired, accept (file type), maxSize (MB)maxSize is configured in MB (e.g., 5 = 5MB)

Custom error messages

Every rule has a configurable message. Use {x} to insert the limit value dynamically.

Message TemplateOutput
Minimum {x} characters"Minimum 3 characters"
Maximum {x} characters allowed"Maximum 100 characters allowed"
Value must be at least {x}"Value must be at least 0"
Select at least {min} options"Select at least 2 options"
The {x} placeholder is replaced at runtime with the actual limit from your property controls. Great for keeping messages in sync with your rules.

Built-in vs. custom pattern

Text-based fields (Text, Textarea, Password) offer two validation modes — pick one or the other, not both.

Built-in (Min/Max)

Set minimum and maximum character counts. Ideal for names, messages, and general text fields.

Example
minLength: 2, maxLength: 50

Custom Pattern (Regex)

Enter a regular expression for format validation. Use it for postal codes, IDs, or any structured format.

Example
^\d{5}(-\d{4})?$ (US ZIP code)
Setting both minLength and maxLength to the same value enforces an exact length — handy for things like ZIP codes (5 and 5).

Success state

When a field passes validation, you can show a success indicator. Configure it in the Properties Panel:

  • Show Success — toggle the success state on or off
  • Success Message — text shown below the field (e.g., "Looks good!")
  • Success Icon — checkmark icon inside the input
  • Success Styles — custom border color, text color, and icon color

Hidden and disabled fields

Fields that are conditionally hidden or disabled automatically skip validation. A required field won't block submission if it's not visible or interactive. See for details.

Related guides