Validation
Field Rules
Errors show after you leave a field, or for every field when you submit. Validation itself runs on every change, so an error clears as soon as you fix it.
What this shows
Each field takes a validate(value) function that returns an error message, or null when the value is valid. See Validation.
- Validation runs on every change. The error shows once the field is touched.
- On submit every field is validated and touched. If any fail,
onError(fieldErrors)is called instead ofonSubmit. - Validators are defined outside the component, because
validateis read once, when the field mounts.
The TextField, NumberField, SelectField and CheckboxField components come from the shared example components.