FormStore

Type that defines the store of a form.

Definition

  • FormStore object
    • element Signal<MaybeValue<HTMLFormElement>>
    • submitCount Signal<number>
    • submitting Signal<boolean>
    • submitted Signal<boolean>
    • validating Signal<boolean>
    • touched Signal<boolean>
    • dirty Signal<boolean>
    • invalid Signal<boolean>
    • response Signal<FormResponse>

The object also contains a key named internal which provides API's that we need internally in the library. You should not access it. Instead, use the form, field and array methods we provide you.

Explanation

The properties of the form are reactive and can be used, for example, in the JSX area or the useTask$ hook.

Errors that occur when submitting the form are made accessible via the response object. In conjunction with the setResponse method, you can also use response to display custom feedback to your user.