Skip to content

API reference > @kontsedal/olas-core > ValidateOn

ValidateOn type ​

When a field's validators are first allowed to run.

  • 'change' (default) — validators run on every set(). Matches the current behavior, ideal for "type and see errors live." - 'blur' — first run is gated on markTouched(). After that, subsequent value changes do trigger re-validation. UI binding should call markTouched() on onBlur. - 'submit' — first run is gated on revalidate() / Form.submit(). After that, subsequent value changes re-validate. Use when you want "show errors only after the user explicitly tried to submit."

revalidate() always unlocks the field regardless of mode.

Signature:

typescript
type ValidateOn = 'change' | 'blur' | 'submit';

Released under the MIT License.