Type

FormStateCondition

@ng-forge/dynamic-forms

Special form-state conditions for button disabled logic.

These conditions evaluate form or page-level state rather than field values, and are primarily used for controlling button disabled states.

Signature

type FormStateCondition =
  /** True when form.valid() === false */
  | 'formInvalid'
  /** True when form.submitting() === true */
  | 'formSubmitting'
  /** True when fields on the current page are invalid (for paged forms) */
  | 'pageInvalid';

Properties

NameTypeDescription
"formInvalid" literal-
"formSubmitting" literal-
"pageInvalid" literal-

Examples

// Disable submit button when form is invalid or submitting
{
  key: 'submit',
  type: 'submit',
  label: 'Submit',
  logic: [
    { type: 'disabled', condition: 'formInvalid' },
    { type: 'disabled', condition: 'formSubmitting' },
  ]
}

// Disable next button when current page is invalid
nextButton({
  key: 'next',
  label: 'Next',
  logic: [
    { type: 'disabled', condition: 'pageInvalid' },
  ]
})