Hex Core JS
    Preparing search index...

    Function maxLengthValidator

    • Returns a validation function to validate that the length of the value is less than or equal to the max length, if given.

      Note: null values count as valid.

      Parameters

      • OptionalmaxLength: number

        The maximum allowed length of a value.

      • OptionalerrorMessage: string

        A custom error message to display if the value is invalid.

      Returns SyncValidationFunction<ElementWithLength | null>