Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

FormValidator.md

145 lines3.2 KB

Defined in: validation.public.ts:816

Configures validation of complete form values on the client or server.

Extends

Type Parameters

TFormData

TFormData

Library-managed. Do not specify explicitly.

Properties

bailIfInvalid?

optional bailIfInvalid?: boolean;

Defined in: validation.public.ts:29

If true, skips this and subsequent validators when earlier validation has failed.

If false, earlier failures do not prevent this validator from running.

Default

false

Inherited from

BaseValidator.bailIfInvalid


run

run: 
  | FormValidatorFn<TFormData>
| StandardSchemaV1<TFormData, any>;

Defined in: validation.public.ts:21

The function or Standard Schema that validates the value in this validator's scope.

Inherited from

BaseValidator.run


runOnMount?

optional runOnMount?: boolean;

Defined in: validation.public.ts:833

Whether this validator runs when the form is constructed.

Default

false

skipOnSubmit?

optional skipOnSubmit?: 
  | boolean
| ValidationPredicateFn<TFormData, TFormData, "form">;

Defined in: validation.public.ts:827

Whether this validator runs during a client submission attempt, independently of triggers.

Pass a boolean or a function that returns true to skip it for the current attempt.

Default

false

triggerDebounceMs?

optional triggerDebounceMs?: 
  | number
| ValidationDebounceFn<TFormData, TFormData, "form">;

Defined in: validation.public.ts:843

The delay in milliseconds before validation runs for change or blur events.

Pass a number for a fixed delay, or pass a function that returns the delay for the current event. Repeated events restart the delay. Submission and server validation run immediately.

Default

0

triggers

triggers: FormValidationTriggerOption<TFormData, TFormData, "form">[];

Defined in: validation.public.ts:852

Change and blur events that can run this validator, optionally with conditions. Add 'server' to include it in serverValidate.

An empty array disables change, blur, and server validation. Configure client submission separately with skipOnSubmit and initial validation with runOnMount.