FormValidators

Interface: FormValidators<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync>

Defined in: packages/form-core/src/FormApi.ts:158

Type Parameters

TFormData

TOnMount extends undefined | FormValidateOrFn<TFormData>

TOnChange extends undefined | FormValidateOrFn<TFormData>

TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>

TOnBlur extends undefined | FormValidateOrFn<TFormData>

TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>

TOnSubmit extends undefined | FormValidateOrFn<TFormData>

TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>

Properties

onBlur?

ts
optional onBlur: TOnBlur;
optional onBlur: TOnBlur;

Defined in: packages/form-core/src/FormApi.ts:187

Optional function that validates the form data when a field loses focus, returns a FormValidationError


onBlurAsync?

ts
optional onBlurAsync: TOnBlurAsync;
optional onBlurAsync: TOnBlurAsync;

Defined in: packages/form-core/src/FormApi.ts:191

Optional onBlur asynchronous validation method for when a field loses focus returns a FormValidationError or a promise of Promise<FormValidationError>


onBlurAsyncDebounceMs?

ts
optional onBlurAsyncDebounceMs: number;
optional onBlurAsyncDebounceMs: number;

Defined in: packages/form-core/src/FormApi.ts:195

The default time in milliseconds that if set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds.


onChange?

ts
optional onChange: TOnChange;
optional onChange: TOnChange;

Defined in: packages/form-core/src/FormApi.ts:175

Optional function that checks the validity of your data whenever a value changes


onChangeAsync?

ts
optional onChangeAsync: TOnChangeAsync;
optional onChangeAsync: TOnChangeAsync;

Defined in: packages/form-core/src/FormApi.ts:179

Optional onChange asynchronous counterpart to onChange. Useful for more complex validation logic that might involve server requests.


onChangeAsyncDebounceMs?

ts
optional onChangeAsyncDebounceMs: number;
optional onChangeAsyncDebounceMs: number;

Defined in: packages/form-core/src/FormApi.ts:183

The default time in milliseconds that if set to a number larger than 0, will debounce the async validation event by this length of time in milliseconds.


onMount?

ts
optional onMount: TOnMount;
optional onMount: TOnMount;

Defined in: packages/form-core/src/FormApi.ts:171

Optional function that fires as soon as the component mounts.


onSubmit?

ts
optional onSubmit: TOnSubmit;
optional onSubmit: TOnSubmit;

Defined in: packages/form-core/src/FormApi.ts:196


onSubmitAsync?

ts
optional onSubmitAsync: TOnSubmitAsync;
optional onSubmitAsync: TOnSubmitAsync;

Defined in: packages/form-core/src/FormApi.ts:197

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.