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

formapi.md

933 lines19.0 KB

1---
2id: FormApi
3title: FormApi
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8# Class: FormApi\<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta\>
9​
10Defined in: [packages/form-core/src/FormApi.ts:771](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L771)
11​
12A class representing the Form API. It handles the logic and interactions with the form state.
13​
14Normally, you will not need to create a new `FormApi` instance directly. Instead, you will use a framework
15hook/function like `useForm` or `createForm` to create a new instance for you that uses your framework's reactivity model.
16However, if you need to create a new instance manually, you can do so by calling the `new FormApi` constructor.
17​
18## Type Parameters
19​
20• **TFormData**
21​
22• **TOnMount** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
23​
24• **TOnChange** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
25​
26• **TOnChangeAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
27​
28• **TOnBlur** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
29​
30• **TOnBlurAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
31​
32• **TOnSubmit** *extends* `undefined` \| `FormValidateOrFn`\<`TFormData`\>
33​
34• **TOnSubmitAsync** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
35​
36• **TOnServer** *extends* `undefined` \| `FormAsyncValidateOrFn`\<`TFormData`\>
37​
38• **TSubmitMeta** = `never`
39​
40## Constructors
41​
42### new FormApi()
43​
44```ts
45new FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>(opts?): FormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta>
46```
47​
48Defined in: [packages/form-core/src/FormApi.ts:842](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L842)
49​
50Constructs a new `FormApi` instance with the given form options.
51​
52#### Parameters
53​
54##### opts?
55​
56[`FormOptions`](../../interfaces/formoptions.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
57​
58#### Returns
59​
60[`FormApi`](../formapi.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
61​
62## Properties
63​
64### baseStore
65​
66```ts
67baseStore: Store<BaseFormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer>>;
68```
69​
70Defined in: [packages/form-core/src/FormApi.ts:798](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L798)
71​
72***
73​
74### fieldInfo
75​
76```ts
77fieldInfo: Record<DeepKeys<TFormData>, FieldInfo<TFormData>>;
78```
79​
80Defined in: [packages/form-core/src/FormApi.ts:828](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L828)
81​
82A record of field information for each field in the form.
83​
84***
85​
86### fieldMetaDerived
87​
88```ts
89fieldMetaDerived: Derived<Record<DeepKeys<TFormData>, AnyFieldMeta>>;
90```
91​
92Defined in: [packages/form-core/src/FormApi.ts:811](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L811)
93​
94***
95​
96### options
97​
98```ts
99options: FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer, TSubmitMeta> = {};
100```
101​
102Defined in: [packages/form-core/src/FormApi.ts:786](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L786)
103​
104The options for the form.
105​
106***
107​
108### store
109​
110```ts
111store: Derived<FormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer>>;
112```
113​
114Defined in: [packages/form-core/src/FormApi.ts:812](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L812)
115​
116## Accessors
117​
118### state
119​
120#### Get Signature
121​
122```ts
123get state(): FormState<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnServer>
124```
125​
126Defined in: [packages/form-core/src/FormApi.ts:830](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L830)
127​
128##### Returns
129​
130[`FormState`](../../interfaces/formstate.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`\>
131​
132## Methods
133​
134### deleteField()
135​
136```ts
137deleteField<TField>(field): void
138```
139​
140Defined in: [packages/form-core/src/FormApi.ts:1940](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1940)
141​
142#### Type Parameters
143​
144• **TField** *extends* `string`
145​
146#### Parameters
147​
148##### field
149​
150`TField`
151​
152#### Returns
153​
154`void`
155​
156***
157​
158### getAllErrors()
159​
160```ts
161getAllErrors(): object
162```
163​
164Defined in: [packages/form-core/src/FormApi.ts:2211](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2211)
165​
166Returns form and field level errors
167​
168#### Returns
169​
170`object`
171​
172##### fields
173​
174```ts
175fields: Record<DeepKeys<TFormData>, {
176 errorMap: ValidationErrorMap;
177 errors: unknown[];
178}>;
179```
180​
181##### form
182​
183```ts
184form: object;
185```
186​
187###### form.errorMap
188​
189```ts
190errorMap: ValidationErrorMap<UnwrapFormValidateOrFn<TOnMount>, UnwrapFormValidateOrFn<TOnChange>, UnwrapFormAsyncValidateOrFn<TOnChangeAsync>, UnwrapFormValidateOrFn<TOnBlur>, UnwrapFormAsyncValidateOrFn<TOnBlurAsync>, UnwrapFormValidateOrFn<TOnSubmit>, UnwrapFormAsyncValidateOrFn<TOnSubmitAsync>, UnwrapFormAsyncValidateOrFn<TOnServer>>;
191```
192​
193###### form.errors
194​
195```ts
196errors: (
197 | UnwrapFormValidateOrFn<TOnMount>
198 | UnwrapFormValidateOrFn<TOnChange>
199 | UnwrapFormAsyncValidateOrFn<TOnChangeAsync>
200 | UnwrapFormValidateOrFn<TOnBlur>
201 | UnwrapFormAsyncValidateOrFn<TOnBlurAsync>
202 | UnwrapFormValidateOrFn<TOnSubmit>
203 | UnwrapFormAsyncValidateOrFn<TOnSubmitAsync>
204 | UnwrapFormAsyncValidateOrFn<TOnServer>)[];
205```
206​
207***
208​
209### getFieldInfo()
210​
211```ts
212getFieldInfo<TField>(field): FieldInfo<TFormData>
213```
214​
215Defined in: [packages/form-core/src/FormApi.ts:1854](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1854)
216​
217Gets the field info of the specified field.
218​
219#### Type Parameters
220​
221• **TField** *extends* `string`
222​
223#### Parameters
224​
225##### field
226​
227`TField`
228​
229#### Returns
230​
231[`FieldInfo`](../../type-aliases/fieldinfo.md)\<`TFormData`\>
232​
233***
234​
235### getFieldMeta()
236​
237```ts
238getFieldMeta<TField>(field): undefined | AnyFieldMeta
239```
240​
241Defined in: [packages/form-core/src/FormApi.ts:1845](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1845)
242​
243Gets the metadata of the specified field.
244​
245#### Type Parameters
246​
247• **TField** *extends* `string`
248​
249#### Parameters
250​
251##### field
252​
253`TField`
254​
255#### Returns
256​
257`undefined` \| [`AnyFieldMeta`](../../type-aliases/anyfieldmeta.md)
258​
259***
260​
261### getFieldValue()
262​
263```ts
264getFieldValue<TField>(field): DeepValue<TFormData, TField>
265```
266​
267Defined in: [packages/form-core/src/FormApi.ts:1838](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1838)
268​
269Gets the value of the specified field.
270​
271#### Type Parameters
272​
273• **TField** *extends* `string`
274​
275#### Parameters
276​
277##### field
278​
279`TField`
280​
281#### Returns
282​
283[`DeepValue`](../../type-aliases/deepvalue.md)\<`TFormData`, `TField`\>
284​
285***
286​
287### handleSubmit()
288​
289#### Call Signature
290​
291```ts
292handleSubmit(): Promise<void>
293```
294​
295Defined in: [packages/form-core/src/FormApi.ts:1740](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1740)
296​
297Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks.
298​
299##### Returns
300​
301`Promise`\<`void`\>
302​
303#### Call Signature
304​
305```ts
306handleSubmit(submitMeta): Promise<void>
307```
308​
309Defined in: [packages/form-core/src/FormApi.ts:1741](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1741)
310​
311Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks.
312​
313##### Parameters
314​
315###### submitMeta
316​
317`TSubmitMeta`
318​
319##### Returns
320​
321`Promise`\<`void`\>
322​
323***
324​
325### insertFieldValue()
326​
327```ts
328insertFieldValue<TField>(
329 field,
330 index,
331 value,
332opts?): Promise<void>
333```
334​
335Defined in: [packages/form-core/src/FormApi.ts:1979](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1979)
336​
337#### Type Parameters
338​
339• **TField** *extends* `string`
340​
341#### Parameters
342​
343##### field
344​
345`TField`
346​
347##### index
348​
349`number`
350​
351##### value
352​
353[`DeepValue`](../../type-aliases/deepvalue.md)\<`TFormData`, `TField`\> *extends* `any`[] ? `any`[] & [`DeepValue`](../../type-aliases/deepvalue.md)\<`TFormData`, `TField`\>\[`number`\] : `never`
354​
355##### opts?
356​
357`UpdateMetaOptions`
358​
359#### Returns
360​
361`Promise`\<`void`\>
362​
363***
364​
365### mount()
366​
367```ts
368mount(): () => void
369```
370​
371Defined in: [packages/form-core/src/FormApi.ts:1168](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1168)
372​
373#### Returns
374​
375`Function`
376​
377##### Returns
378​
379`void`
380​
381***
382​
383### moveFieldValues()
384​
385```ts
386moveFieldValues<TField>(
387 field,
388 index1,
389 index2,
390 opts?): void
391```
392​
393Defined in: [packages/form-core/src/FormApi.ts:2103](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2103)
394​
395Moves the value at the first specified index to the second specified index within an array field.
396​
397#### Type Parameters
398​
399• **TField** *extends* `string`
400​
401#### Parameters
402​
403##### field
404​
405`TField`
406​
407##### index1
408​
409`number`
410​
411##### index2
412​
413`number`
414​
415##### opts?
416​
417`UpdateMetaOptions`
418​
419#### Returns
420​
421`void`
422​
423***
424​
425### parseValuesWithSchema()
426​
427```ts
428parseValuesWithSchema(schema):
429 | undefined
430 | {
431 fields: Record<string, StandardSchemaV1Issue[]>;
432 form: Record<string, StandardSchemaV1Issue[]>;
434```
435​
436Defined in: [packages/form-core/src/FormApi.ts:2271](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2271)
437​
438Parses the form's values with a given standard schema and returns
439issues (if any). This method does NOT set any internal errors.
440​
441#### Parameters
442​
443##### schema
444​
445[`StandardSchemaV1`](../../type-aliases/standardschemav1.md)\<`TFormData`, `unknown`\>
446​
447The standard schema to parse the form values with.
448​
449#### Returns
450​
451 \| `undefined`
452 \| \{
453 `fields`: `Record`\<`string`, [`StandardSchemaV1Issue`](../../interfaces/standardschemav1issue.md)[]\>;
454 `form`: `Record`\<`string`, [`StandardSchemaV1Issue`](../../interfaces/standardschemav1issue.md)[]\>;
455 \}
456​
457***
458​
459### parseValuesWithSchemaAsync()
460​
461```ts
462parseValuesWithSchemaAsync(schema): Promise<
463 | undefined
464 | {
465 fields: Record<string, StandardSchemaV1Issue[]>;
466 form: Record<string, StandardSchemaV1Issue[]>;
467}>
468```
469​
470Defined in: [packages/form-core/src/FormApi.ts:2283](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2283)
471​
472Parses the form's values with a given standard schema and returns
473issues (if any). This method does NOT set any internal errors.
474​
475#### Parameters
476​
477##### schema
478​
479[`StandardSchemaV1`](../../type-aliases/standardschemav1.md)\<`TFormData`, `unknown`\>
480​
481The standard schema to parse the form values with.
482​
483#### Returns
484​
485`Promise`\<
486 \| `undefined`
487 \| \{
488 `fields`: `Record`\<`string`, [`StandardSchemaV1Issue`](../../interfaces/standardschemav1issue.md)[]\>;
489 `form`: `Record`\<`string`, [`StandardSchemaV1Issue`](../../interfaces/standardschemav1issue.md)[]\>;
490 \}\>
491​
492***
493​
494### pushFieldValue()
495​
496```ts
497pushFieldValue<TField>(
498 field,
499 value,
500 opts?): void
501```
502​
503Defined in: [packages/form-core/src/FormApi.ts:1964](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1964)
504​
505Pushes a value into an array field.
506​
507#### Type Parameters
508​
509• **TField** *extends* `string`
510​
511#### Parameters
512​
513##### field
514​
515`TField`
516​
517##### value
518​
519[`DeepValue`](../../type-aliases/deepvalue.md)\<`TFormData`, `TField`\> *extends* `any`[] ? `any`[] & [`DeepValue`](../../type-aliases/deepvalue.md)\<`TFormData`, `TField`\>\[`number`\] : `never`
520​
521##### opts?
522​
523`UpdateMetaOptions`
524​
525#### Returns
526​
527`void`
528​
529***
530​
531### removeFieldValue()
532​
533```ts
534removeFieldValue<TField>(
535 field,
536 index,
537opts?): Promise<void>
538```
539​
540Defined in: [packages/form-core/src/FormApi.ts:2037](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2037)
541​
542Removes a value from an array field at the specified index.
543​
544#### Type Parameters
545​
546• **TField** *extends* `string`
547​
548#### Parameters
549​
550##### field
551​
552`TField`
553​
554##### index
555​
556`number`
557​
558##### opts?
559​
560`UpdateMetaOptions`
561​
562#### Returns
563​
564`Promise`\<`void`\>
565​
566***
567​
568### replaceFieldValue()
569​
570```ts
571replaceFieldValue<TField>(
572 field,
573 index,
574 value,
575opts?): Promise<void>
576```
577​
578Defined in: [packages/form-core/src/FormApi.ts:2011](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2011)
579​
580Replaces a value into an array field at the specified index.
581​
582#### Type Parameters
583​
584• **TField** *extends* `string`
585​
586#### Parameters
587​
588##### field
589​
590`TField`
591​
592##### index
593​
594`number`
595​
596##### value
597​
598[`DeepValue`](../../type-aliases/deepvalue.md)\<`TFormData`, `TField`\> *extends* `any`[] ? `any`[] & [`DeepValue`](../../type-aliases/deepvalue.md)\<`TFormData`, `TField`\>\[`number`\] : `never`
599​
600##### opts?
601​
602`UpdateMetaOptions`
603​
604#### Returns
605​
606`Promise`\<`void`\>
607​
608***
609​
610### reset()
611​
612```ts
613reset(values?, opts?): void
614```
615​
616Defined in: [packages/form-core/src/FormApi.ts:1256](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1256)
617​
618Resets the form state to the default values.
619If values are provided, the form will be reset to those values instead and the default values will be updated.
620​
621#### Parameters
622​
623##### values?
624​
625`TFormData`
626​
627Optional values to reset the form to.
628​
629##### opts?
630​
631Optional options to control the reset behavior.
632​
633###### keepDefaultValues?
634​
635`boolean`
636​
637#### Returns
638​
639`void`
640​
641***
642​
643### resetField()
644​
645```ts
646resetField<TField>(field): void
647```
648​
649Defined in: [packages/form-core/src/FormApi.ts:2131](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2131)
650​
651Resets the field value and meta to default state
652​
653#### Type Parameters
654​
655• **TField** *extends* `string`
656​
657#### Parameters
658​
659##### field
660​
661`TField`
662​
663#### Returns
664​
665`void`
666​
667***
668​
669### resetFieldMeta()
670​
671```ts
672resetFieldMeta<TField>(fieldMeta): Record<TField, AnyFieldMeta>
673```
674​
675Defined in: [packages/form-core/src/FormApi.ts:1894](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1894)
676​
677resets every field's meta
678​
679#### Type Parameters
680​
681• **TField** *extends* `string`
682​
683#### Parameters
684​
685##### fieldMeta
686​
687`Record`\<`TField`, [`AnyFieldMeta`](../../type-aliases/anyfieldmeta.md)\>
688​
689#### Returns
690​
691`Record`\<`TField`, [`AnyFieldMeta`](../../type-aliases/anyfieldmeta.md)\>
692​
693***
694​
695### setErrorMap()
696​
697```ts
698setErrorMap(errorMap): void
699```
700​
701Defined in: [packages/form-core/src/FormApi.ts:2149](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2149)
702​
703Updates the form's errorMap
704​
705#### Parameters
706​
707##### errorMap
708​
709`FormValidationErrorMap`\<`TFormData`, [`UnwrapFormValidateOrFn`](../../type-aliases/unwrapformvalidateorfn.md)\<`TOnMount`\>, [`UnwrapFormValidateOrFn`](../../type-aliases/unwrapformvalidateorfn.md)\<`TOnChange`\>, [`UnwrapFormAsyncValidateOrFn`](../../type-aliases/unwrapformasyncvalidateorfn.md)\<`TOnChangeAsync`\>, [`UnwrapFormValidateOrFn`](../../type-aliases/unwrapformvalidateorfn.md)\<`TOnBlur`\>, [`UnwrapFormAsyncValidateOrFn`](../../type-aliases/unwrapformasyncvalidateorfn.md)\<`TOnBlurAsync`\>, [`UnwrapFormValidateOrFn`](../../type-aliases/unwrapformvalidateorfn.md)\<`TOnSubmit`\>, [`UnwrapFormAsyncValidateOrFn`](../../type-aliases/unwrapformasyncvalidateorfn.md)\<`TOnSubmitAsync`\>, [`UnwrapFormAsyncValidateOrFn`](../../type-aliases/unwrapformasyncvalidateorfn.md)\<`TOnServer`\>\>
710​
711#### Returns
712​
713`void`
714​
715***
716​
717### setFieldMeta()
718​
719```ts
720setFieldMeta<TField>(field, updater): void
721```
722​
723Defined in: [packages/form-core/src/FormApi.ts:1873](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1873)
724​
725Updates the metadata of the specified field.
726​
727#### Type Parameters
728​
729• **TField** *extends* `string`
730​
731#### Parameters
732​
733##### field
734​
735`TField`
736​
737##### updater
738​
739[`Updater`](../../type-aliases/updater.md)\<[`AnyFieldMetaBase`](../../type-aliases/anyfieldmetabase.md)\>
740​
741#### Returns
742​
743`void`
744​
745***
746​
747### setFieldValue()
748​
749```ts
750setFieldValue<TField>(
751 field,
752 updater,
753 opts?): void
754```
755​
756Defined in: [packages/form-core/src/FormApi.ts:1910](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1910)
757​
758Sets the value of the specified field and optionally updates the touched state.
759​
760#### Type Parameters
761​
762• **TField** *extends* `string`
763​
764#### Parameters
765​
766##### field
767​
768`TField`
769​
770##### updater
771​
772[`Updater`](../../type-aliases/updater.md)\<[`DeepValue`](../../type-aliases/deepvalue.md)\<`TFormData`, `TField`\>\>
773​
774##### opts?
775​
776`UpdateMetaOptions`
777​
778#### Returns
779​
780`void`
781​
782***
783​
784### swapFieldValues()
785​
786```ts
787swapFieldValues<TField>(
788 field,
789 index1,
790 index2,
791 opts?): void
792```
793​
794Defined in: [packages/form-core/src/FormApi.ts:2074](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L2074)
795​
796Swaps the values at the specified indices within an array field.
797​
798#### Type Parameters
799​
800• **TField** *extends* `string`
801​
802#### Parameters
803​
804##### field
805​
806`TField`
807​
808##### index1
809​
810`number`
811​
812##### index2
813​
814`number`
815​
816##### opts?
817​
818`UpdateMetaOptions`
819​
820#### Returns
821​
822`void`
823​
824***
825​
826### update()
827​
828```ts
829update(options?): void
830```
831​
832Defined in: [packages/form-core/src/FormApi.ts:1188](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1188)
833​
834Updates the form options and form state.
835​
836#### Parameters
837​
838##### options?
839​
840[`FormOptions`](../../interfaces/formoptions.md)\<`TFormData`, `TOnMount`, `TOnChange`, `TOnChangeAsync`, `TOnBlur`, `TOnBlurAsync`, `TOnSubmit`, `TOnSubmitAsync`, `TOnServer`, `TSubmitMeta`\>
841​
842#### Returns
843​
844`void`
845​
846***
847​
848### validateAllFields()
849​
850```ts
851validateAllFields(cause): Promise<unknown[]>
852```
853​
854Defined in: [packages/form-core/src/FormApi.ts:1282](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1282)
855​
856Validates all fields using the correct handlers for a given validation cause.
857​
858#### Parameters
859​
860##### cause
861​
862`ValidationCause`
863​
864#### Returns
865​
866`Promise`\<`unknown`[]\>
867​
868***
869​
870### validateArrayFieldsStartingFrom()
871​
872```ts
873validateArrayFieldsStartingFrom<TField>(
874 field,
875 index,
876cause): Promise<unknown[]>
877```
878​
879Defined in: [packages/form-core/src/FormApi.ts:1312](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1312)
880​
881Validates the children of a specified array in the form starting from a given index until the end using the correct handlers for a given validation type.
882​
883#### Type Parameters
884​
885• **TField** *extends* `string`
886​
887#### Parameters
888​
889##### field
890​
891`TField`
892​
893##### index
894​
895`number`
896​
897##### cause
898​
899`ValidationCause`
900​
901#### Returns
902​
903`Promise`\<`unknown`[]\>
904​
905***
906​
907### validateField()
908​
909```ts
910validateField<TField>(field, cause): unknown[] | Promise<unknown[]>
911```
912​
913Defined in: [packages/form-core/src/FormApi.ts:1353](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi.ts#L1353)
914​
915Validates a specified field in the form using the correct handlers for a given validation type.
916​
917#### Type Parameters
918​
919• **TField** *extends* `string`
920​
921#### Parameters
922​
923##### field
924​
925`TField`
926​
927##### cause
928​
929`ValidationCause`
930​
931#### Returns
932​
933`unknown`[] \| `Promise`\<`unknown`[]\>