Validation of input type questions involves checking a user's answer to determine if it conforms to defined requirements. Validation settings can be defined for text input and number input questions. 

The following types of validation are available:

  • Custom: This validation type is provided for text input questions (both Short Text and Multiline). The validation involves checking whether the answer is consistent with requirements defined in a regular expression.
  • Range: This validation type is provided for number input questions. The validation involves checking whether the number entered by the user is within a defined range. 

For both types of validation, you can specify a message that will be displayed to users whose answers do not pass the validation test. In the following example, the user entered input that was inconsistent with the format of an email address:

Setting Range Validation 

Configuring range validation settings is part of designing a number input question. Setting the validation involves specifying the relevant range and defining an error message.

To configure range validation:

  1. Open the Page Editor of the relevant number input question, and select the Element tab.
  2. From the Validation Type dropdown list, select Range



    Range validation parameters are displayed.

  3. Define the required range: 
    • In the Lower Limit field, enter the lowest valid number in the range. Alternatively, use the yellow Up/Down arrow buttons to navigate to the lower limit.
    • In the Upper Limit field, enter the highest valid number in the range. Alternatively, use the yellow Up/Down arrow buttons to navigate to the upper limit.

  4. If desired, in the Error Message field, enter text that will be displayed to users who enter an invalid answer.

  5. To save your changes, at the lower right corner of the Page Editor, click Update Page.
    The Page Editor closes, and the Interaction Map is displayed.

Setting Custom Validation 

Configuring custom validation settings is part of designing a text input question. Setting the validation involves specifying the required regular expression. For example, you could define a regular expression to check for an email address format, or to check for use of capital letters.

To configure custom validation:

  1. Open the Page Editor of the relevant text input question, and select the Element tab.
  2. From the Validation Type dropdown list, select Custom




    Custom validation parameters are displayed.

  3. In the Regular Expression field, enter the relevant regular expression. 
  4. If desired, in the Error Message field, enter text that will be displayed to users who enter an invalid answer.

  5. To save your changes, at the lower right corner of the Page Editor, click Update Page.
    The Page Editor closes, and the Interaction Map is displayed.

 

 

Revision:

Comments