Defined in: FormApi/formSubmit.public.ts:210
Gives the form's onSubmit callback its submitted values, validator outputs, form API, and error helpers after submission validation succeeds.
TFormData
Library-managed. Do not specify explicitly.
TValidatorOutputs extends readonly unknown[]
Library-managed. Do not specify explicitly.
createErrorMap: CreateSubmitErrorMapFn<TFormData>;Defined in: FormApi/formSubmit.public.ts:172
Builds a mutable map of submission errors from optional initial errors.
formOptions({
defaultValues: { name: '' },
onSubmit: async ({ value, createErrorMap }) => {
const errors = createErrorMap()
if (await nameIsTaken(value.name)) {
errors.addFieldError('name', 'Name is already taken')
}
return errors
},
})BaseSubmitContext.createErrorMap
createValidationError: CreateValidationErrorFn<TFormData>;Defined in: FormApi/formSubmit.public.ts:144
Wraps existing errors so onSubmit can return them as validation errors. Calling this helper alone does not update validation state.
Accepts error messages, issue objects, arrays of errors, or an error map. For a group, field paths in an error map are relative to the group.
formOptions({
defaultValues: { name: '' },
onSubmit: async ({ value, createValidationError }) => {
if (await nameIsTaken(value.name)) {
return createValidationError('Name is already taken')
}
await saveProfile(value)
},
})BaseSubmitContext.createValidationError
formApi: FormApi<TFormData, ScopedErrorTypes<never, never>>;Defined in: FormApi/formSubmit.public.ts:229
The form handling this submission.
Important: A user may edit fields during submission. value and formApi.state.values may not be equal.
parseIssues: ParseSubmitIssuesFn<TFormData>;Defined in: FormApi/formSubmit.public.ts:200
Converts Standard Schema issues into a mutable error map to return from onSubmit.
formOptions({
defaultValues: { name: '' },
onSubmit: async ({ value, parseIssues }) => {
const result = parseSchema(mySchema, value)
if (!result.success) {
return parseIssues(result.issues)
}
await saveProfile(result.data)
},
})signal: AbortSignal;Defined in: FormApi/formSubmit.public.ts:118
Signals when this submission attempt is invalidated.
Important: Aborting prevents submission results from updating form or group state. Callbacks already started are still awaited, and their exceptions retain normal handling. Use the signal to stop external work that supports cancellation.
validatorOutputs: TValidatorOutputs;Defined in: FormApi/formSubmit.public.ts:257
Outputs from this submission's form validators, in validators array order.
formOptions({
defaultValues: { name: '' },
validators: [
{
triggers: [],
run: ({ createOutput, value }) =>
createOutput({ displayName: value.name.trim() }),
},
{ triggers: [], run: mySchema },
],
onSubmit: async ({ validatorOutputs }) => {
const [customData, schemaOutput] = validatorOutputs
await saveProfile(customData.displayName, schemaOutput)
},
})value: TFormData;Defined in: FormApi/formSubmit.public.ts:221
The form values captured when this submission started, without schema transformations applied.
Field edits made while submission is pending do not replace these values. Read transformed validator results from validatorOutputs.