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

ValidationTriggerConfig.md

69 lines1.5 KB

1---
2id: ValidationTriggerConfig
3title: ValidationTriggerConfig
4---
5​
6Defined in: [validation.public.ts:506](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L506)
7​
8A change or blur event with an optional condition for running validation.
9​
10## Type Parameters
11​
12### TFormData
13​
14`TFormData`
15​
16Library-managed. Do not specify explicitly.
17​
18### TValue
19​
20`TValue`
21​
22Library-managed. Do not specify explicitly.
23​
24### TTrigger
25​
26`TTrigger` *extends* [`ValidatorTrigger`](../type-aliases/ValidatorTrigger.md) = [`ValidatorTrigger`](../type-aliases/ValidatorTrigger.md)
27​
28Library-managed. Do not specify explicitly.
29​
30### TScope
31​
32`TScope` *extends* [`ValidatorScope`](../type-aliases/ValidatorScope.md) = [`ValidatorScope`](../type-aliases/ValidatorScope.md)
33​
34Library-managed. Do not specify explicitly.
35​
36## Properties
37​
38### trigger
39​
40```ts
41trigger: TTrigger;
42```
43​
44Defined in: [validation.public.ts:513](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L513)
45​
46The event to match before evaluating `when`.
47​
48***
49​
50### when?
51​
52```ts
53optional when?:
54 | boolean
55| ValidationPredicateFn<TFormData, TValue, TScope>;
56```
57​
58Defined in: [validation.public.ts:522](https://github.com/TanStack/form/blob/main/packages/form-core/src/validation.public.ts#L522)
59​
60Whether this trigger enables validation when its event occurs.
61​
62Pass a boolean to enable or disable it, or pass a function that returns
63`true` to enable it for the current event.
64​
65#### Default
66​
67```ts
68true
69```