Skip to content

@opencraft/providence


Interface: FormModuleOptions\<T>

Defined in: forms/types/FormModuleOptions.ts:8

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

T

T

Properties

disabled?

optional disabled?: boolean

Defined in: forms/types/FormModuleOptions.ts:33

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.


endpoint?

optional endpoint?: string

Defined in: forms/types/FormModuleOptions.ts:18

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


errors?

optional errors?: default

Defined in: forms/types/FormModuleOptions.ts:28

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'.


fields

fields: FieldSetOptions\<T>

Defined in: forms/types/FormModuleOptions.ts:23

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


persistent?

optional persistent?: boolean

Defined in: forms/types/FormModuleOptions.ts:37

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


step?

optional step?: number

Defined in: forms/types/FormModuleOptions.ts:44

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.