Skip to content

Interface: FieldOptions<ValType>

forms/types/FieldOptions.FieldOptions

Type parameters

Name
ValType

Properties

debounce

Optional debounce: number

To prevent the annoying artifact of checking a value before the user is finished typing, the debounce value for the field may be set. This throttles how often the validators are run. Validators run after input has changed and the number of milliseconds specified by this attribute have passed.

Defined in

src/base/forms/types/FieldOptions.ts:31


disabled

Optional disabled: boolean

Indicates whether this field should be marked disabled. This does not affect providence's behavior, but is useful when rendering fields in your desired component/template framework.

Defined in

src/base/forms/types/FieldOptions.ts:8


errors

Optional errors: string[]

A list of errors this field has. These may come from the validators, or from a failed form submission.

Defined in

src/base/forms/types/FieldOptions.ts:25


initialValue

Optional initialValue: ValType

The field's 'initial' value. In most cases this is taken from the value property, but it can be specified manually if needed. Its function is to replace the current value when the form is reset.

Defined in

src/base/forms/types/FieldOptions.ts:21


omitIf

Optional omitIf: any

If the value equals this attribute, omit the field from the resulting data when constructing it for submission. This can be used in cases where the presence of the key itself has significance, or when it could cause visual artifacts. An example might be when constructing a query string for a search page-- if a searchable attribute isn't specified, you probably don't want it in the URL!

Defined in

src/base/forms/types/FieldOptions.ts:38


step

Optional step: number

The 'step' this field is on. Forms can be constructed in wizard-like fashion, with several fields on one step, and several steps in a form before submission. See the information on the form module's step attribute for more information.

Defined in

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


validators

Optional validators: ValidatorSpec<object>[]

Validators used to check the data in this field. See the documentation on Validators for more information.

Defined in

src/base/forms/types/FieldOptions.ts:12


value

value: ValType

The field's current value.

Defined in

src/base/forms/types/FieldOptions.ts:16