Open History to see the last commit
1---
2id: FieldValidator
3title: FieldValidator
4---
5β
6Defined in: [validation.public.ts:983](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L983)
7β
8Configures validation of a field's value, optionally reacting to related fields.
9β
10## Extends
11β
12- [`Validator`](Validator.md)\<`TFormData`,
13 \| [`FieldValidatorFn`](../type-aliases/FieldValidatorFn.md)\<`TFormData`, `TFieldName`, `TFieldValue`\>
14 \| [`StandardSchemaV1`](../type-aliases/StandardSchemaV1.md)\<`TFieldValue`, `any`\>, `TFieldValue`, [`ConfigurableValidationTrigger`](../type-aliases/ConfigurableValidationTrigger.md), `"field"`\>
15β
16## Type Parameters
17β
18### TFormData
19β
20`TFormData`
21β
22Library-managed. Do not specify explicitly.
23β
24### TFieldName
25β
26`TFieldName`
27β
28Library-managed. Do not specify explicitly.
29β
30### TFieldValue
31β
32`TFieldValue`
33β
34Library-managed. Do not specify explicitly.
35β
36## Properties
37β
38### bailIfInvalid?
39β
40```ts
41optional bailIfInvalid?: boolean;
42```
43β
44Defined in: [validation.public.ts:29](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L29)
45β
46If `true`, skips this and subsequent validators when earlier validation has failed.
47β
48If `false`, earlier failures do not prevent this validator from running.
49β
50#### Default
51β
52```ts
53false
54```
55β
56#### Inherited from
57β
58[`Validator`](Validator.md).[`bailIfInvalid`](Validator.md#bailifinvalid)
59β
60***
61β
62### run
63β
64```ts
65run:
66 | FieldValidatorFn<TFormData, TFieldName, TFieldValue>
67| StandardSchemaV1<TFieldValue, any>;
68```
69β
70Defined in: [validation.public.ts:21](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L21)
71β
72The function or Standard Schema that validates the value in this validator's scope.
73β
74#### Inherited from
75β
76[`Validator`](Validator.md).[`run`](Validator.md#run)
77β
78***
79β
80### runOnMount?
81β
82```ts
83optional runOnMount?: boolean;
84```
85β
86Defined in: [validation.public.ts:64](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L64)
87β
88Whether this validator runs when the form is constructed or when its field
89or form group first mounts.
90β
91#### Default
92β
93```ts
94false
95```
96β
97#### Inherited from
98β
99[`Validator`](Validator.md).[`runOnMount`](Validator.md#runonmount)
100β
101***
102β
103### skipOnSubmit?
104β
105```ts
106optional skipOnSubmit?:
107 | boolean
108| ValidationPredicateFn<TFormData, TFieldValue, "field">;
109```
110β
111Defined in: [validation.public.ts:56](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L56)
112β
113Whether this validator runs during a submission attempt, independently of `triggers`.
114β
115Pass a boolean directly, or pass a function that returns
116`true` to skip it for the current attempt.
117β
118#### Default
119β
120```ts
121false
122```
123β
124#### Inherited from
125β
126[`Validator`](Validator.md).[`skipOnSubmit`](Validator.md#skiponsubmit)
127β
128***
129β
130### triggerDebounceMs?
131β
132```ts
133optional triggerDebounceMs?:
134 | number
135| ValidationDebounceFn<TFormData, TFieldValue, "field">;
136```
137β
138Defined in: [validation.public.ts:74](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L74)
139β
140The delay in milliseconds before validation runs for change or blur events.
141β
142Pass a number for a fixed delay, or pass a function that returns the delay
143for the current event. Repeated events restart the delay.
144Submission validation runs immediately.
145β
146#### Default
147β
148```ts
1490
150```
151β
152#### Inherited from
153β
154[`Validator`](Validator.md).[`triggerDebounceMs`](Validator.md#triggerdebouncems)
155β
156***
157β
158### triggers
159β
160```ts
161triggers: ValidationTriggerOption<TFormData, TFieldValue, ConfigurableValidationTrigger, "field">[];
162```
163β
164Defined in: [validation.public.ts:82](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L82)
165β
166Change and blur events that can run this validator, optionally with conditions.
167β
168An empty array disables change and blur validation. Configure submission
169separately with `skipOnSubmit` and initial validation with `runOnMount`.
170β
171#### Inherited from
172β
173[`Validator`](Validator.md).[`triggers`](Validator.md#triggers)
174β
175***
176β
177### watchFields?
178β
179```ts
180optional watchFields?: DeepKeys<TFormData>[];
181```
182β
183Defined in: [validation.public.ts:1001](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L1001)
184β
185Other field paths whose change or blur events can run this validator.
186β
187Events must still match an enabled entry in `triggers`. The validator
188receives its own field's value, even when a watched field caused the event.