Skip to main content

Form Validators

  • min(val: UseFormValue, minVal: number): boolean
    Validator that requires the control's value to be greater than or equal to the provided number.

  • max(val: UseFormValue, maxVal: number): boolean
    Validator that requires the control's value to be less than or equal to the provided number.

  • required(val: UseFormValue): boolean
    Validator that requires the control have a non-empty value.

  • requiredTrue(val: UseFormValue): boolean
    Validator that requires the control's value be true. This validator is commonly used for required checkboxes.

  • equal(withName: string): boolean
    Validator that requires the control's value to be equal with other control's value. This validator is commonly used to compare passwords.

  • email(val: UseFormValue): boolean
    Validator that requires the control's value pass an email validation test.

  • minLength(val: UseFormValue, minLengh: number): boolean
    Validator that requires the length of the control's value to be greater than or equal to the provided minimum length.

  • maxLength(val: UseFormValue, maxLength: number): boolean
    Validator that requires the length of the control's value to be less than or equal to the provided maximum length.

  • pattern(pattern: string | RegExp): boolean
    Validator that requires the control's value to match a regex pattern.

  • numeric(val: UseFormValue): boolean
    Validator that requires the control's value pass numeric validation test.

  • decimal(val: UseFormValue): boolean
    Validator that requires the control's value pass decimal validation test.