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

FormSubmitInvalidContext.md

59 lines1.1 KB

1---
2id: FormSubmitInvalidContext
3title: FormSubmitInvalidContext
4---
5​
6Defined in: [FormApi/FormApi.public.ts:220](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi/FormApi.public.ts#L220)
7​
8Context passed to `onSubmitInvalid` when a submission fails.
9​
10## Example
11​
12```ts
14 // ...
15 onSubmitInvalid: () => {
16 document
17 .querySelector<HTMLElement>('[aria-invalid="true"]')
18 ?.focus()
19 },
21```
22​
23## Type Parameters
24​
25### TFormData
26​
27`TFormData`
28​
29Library-managed. Do not specify explicitly.
30​
31### TFormErrorTypes
32​
33`TFormErrorTypes` *extends* [`FormErrorTypes`](FormErrorTypes.md)
34​
35Library-managed. Do not specify explicitly.
36​
37## Properties
38​
39### formApi
40​
41```ts
42formApi: FormApi<TFormData, TFormErrorTypes>;
43```
44​
45Defined in: [FormApi/FormApi.public.ts:227](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi/FormApi.public.ts#L227)
46​
47The form API handling the failed submission.
48​
49***
50​
51### value
52​
53```ts
54value: TFormData;
55```
56​
57Defined in: [FormApi/FormApi.public.ts:225](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormApi/FormApi.public.ts#L225)
58​
59The form values for the failed submission.