Skip to content

Interface: FormModuleOptions<T>

forms/types/FormModuleOptions.FormModuleOptions

The construction parameters are mostly state that the FormModule will be initialized with. This contains both the values of the fields themselves and meta information about the form's status and how it is to be managed.

Type parameters

Name
T

Properties

disabled

Optional disabled: boolean

Whether the form should be considered disabled. This does not affect providence's behavior but may be useful when rendering in your favorite frontend template/component framework.

Defined in

src/base/forms/types/FormModuleOptions.ts:33


endpoint

Optional endpoint: string

The endpoint this form is to be submitted to. Defaults to '#'.

Defined in

src/base/forms/types/FormModuleOptions.ts:18


errors

Optional errors: default

Errors on the form itself, as opposed to the individual fields. Also contains the status of the last submission attempt, normalized to a string, such as '500', 'UKNOWN' or 'ECONNABORTED'.

Defined in

src/base/forms/types/FormModuleOptions.ts:28


fields

fields: FieldSetOptions<T>

Key-value sets of fields of this form. See FieldOptions for the values.

Defined in

src/base/forms/types/FormModuleOptions.ts:23


name

Private name: string

The name of the module. Don't specify this-- it will be automatically supplied internally elsewhere.

Defined in

src/base/forms/types/FormModuleOptions.ts:14


persistent

Optional persistent: boolean

If true, this form will not be removed from the data store even when all listeners have been removed from it.

Defined in

src/base/forms/types/FormModuleOptions.ts:37


step

Optional step: number

Forms may have 'steps' for wizard-like functionality. This keeps track of the current step of the form. When an error is returned by the server, providence will roll the step back to the first step which contains a field with an error. See FieldOptions for setting the step of a particular field.

Defined in

src/base/forms/types/FormModuleOptions.ts:44