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

FormGroupSubmitInvalidContext.md

79 lines1.6 KB

1---
2id: FormGroupSubmitInvalidContext
3title: FormGroupSubmitInvalidContext
4---
5​
6Defined in: [FormGroupApi/FormGroupApi.public.ts:80](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L80)
7​
8Context passed to a form group's `onSubmitInvalid` when submission fails.
9​
10## Example
11​
12```ts
14 // ...
15 onSubmitInvalid: ({ groupApi }) => {
16 document
17 .querySelector<HTMLElement>('[aria-invalid="true"]')
18 ?.focus()
19 },
21```
22​
23## Type Parameters
24​
25### TFormData
26​
27`TFormData`
28​
29### TGroupName
30​
31`TGroupName`
32​
33### TGroupValue
34​
35`TGroupValue`
36​
37### TGroupErrorTypes
38​
39`TGroupErrorTypes` *extends* [`FormErrorTypes`](FormErrorTypes.md)
40​
41### TFormErrorTypes
42​
43`TFormErrorTypes` *extends* [`FormErrorTypes`](FormErrorTypes.md)
44​
45## Properties
46​
47### formApi
48​
49```ts
50formApi: FormApi<TFormData, TFormErrorTypes>;
51```
52​
53Defined in: [FormGroupApi/FormGroupApi.public.ts:90](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L90)
54​
55The parent form API handling the failed submission.
56​
57***
58​
59### groupApi
60​
61```ts
62groupApi: FormGroupApi<TFormData, TGroupName, TGroupValue, TGroupErrorTypes, TFormErrorTypes>;
63```
64​
65Defined in: [FormGroupApi/FormGroupApi.public.ts:92](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L92)
66​
67The group API handling the failed submission.
68​
69***
70​
71### value
72​
73```ts
74value: TGroupValue;
75```
76​
77Defined in: [FormGroupApi/FormGroupApi.public.ts:88](https://github.com/TanStack/form/blob/main/packages/form-core/src/FormGroupApi/FormGroupApi.public.ts#L88)
78​
79The group values for the failed submission.