blessed-components - v1.20.0
    Preparing search index...

    Interface FormStateModel

    Controlled or uncontrolled form registry and validation model.

    interface FormStateModel {
        errors(): FormErrors;
        fieldValue(id: string): unknown;
        registerField(field: FormFieldDefinition): void;
        reset(): FormValues;
        setOptions(options: CreateFormStateOptions): void;
        setValue(id: string, value: unknown): boolean;
        submit(): FormSubmitResult;
        unregisterField(id: string): void;
        validate(): FormErrors;
        values(): FormValues;
    }
    Index

    Methods

    • Sets a field value and reports whether the field exists.

      Parameters

      • id: string
      • value: unknown

      Returns boolean