Validation of text and numeric inputs

Use input validation to give custom error messages in case of wrong input.

Created by Batuhan Özgü

Input validation

You can put custom error messages according to the Test-taker's input. Input validation makes use of Regular expressions(Regex) to create the error messages. So some knowledge of Regular expressions is required to use this function.

You can use Input validation with the following input types:

  • Text field
    • Text area
      • Numerical

        Input validation functions

        There are 2 input validation functions:

        • Should match: The input Should match the Regular expression.
          • Should not match: The input Should not match the Regular expression.

            Examples

            \s

            \s : Detects the usage of spaces.

             The validation returns an error if the input includes space.
            The validation returns an error if the input includes space.
            [^0-9]

            [^0-9] : Looks for digits in the input.

             The validation returns an error if the input doesn't include digits.
            The validation returns an error if the input doesn't include digits.
            
The validation returns an error if the input included digits.
            The validation returns an error if the input included digits.
            [1-9]

            [1-9] : Looks for one-digit natural numbers in the input.

            The validation returns an error if the input includes anything except one-digit natural numbers
            The validation returns an error if the input includes anything except one-digit natural numbers
            The validation returns an error if the input includes any one-digit natural numbers
            The validation returns an error if the input includes any one-digit natural numbers
            Go Back

            Start designing online assessments with Testinvite today