Define a validation rule for number and age questions

Number questions have multiple validation rules available.

When setting validation rules, age questions have the particularity that they can be treated as numbers, referring to the age value, or as dates by using the Date of Birth. To set a validation rule related to the Date of Birth, see Define a validation rule for Date/Time and Date of birth questions.

You can define more than one validation rule for a number or age question, if applicable. For age questions you can combine Age validation rules with Date of Birth validation rules.

Repeat the steps to add new rules as required and, once you have added the new rules, select a logical operator from the drop-down between rules:
  • If you select AND, the value must be valid for every validation rule.
  • If you select OR, the value must be valid for exactly one validation rule.
  1. Navigate to Rules sidebar, as described in Access the rules section.
  2. Click Add Validation Rule and select one of the available validation rules:
    Validation rule type Description
    Greater Than A site user must enter a number that is greater than the specified value.
    Greater Than or Equal To A site user must enter a number that is greater than or equal to the specified value.
    Less Than A site user must enter a number that is less than the specified value.
    Less Than or Equal To A site user must enter a number that is less than or equal to the specified value.
    Is A site user must enter a number that is exactly the specified value.
    Not Equal To A site user must enter a number that is not equal to the specified value.
    Not Between A site user must enter a number that is not between the specified range of values.
    Range A site user must enter a number that is between the specified range of values.

    Note:

    For age questions, these options will be available to select once you select Age from the Add Validation Rule drop-down. In these cases, the box is titled Age Rule.
    A Validation Rule box appears with editable settings.
    Validation rules are a set of settings that you configure.
  3. Enter values according to the type of validation rule:
    Option Description
    For rules of type:
    • Greater Than
    • Greater Than or Equal To
    • Less Than
    • Less Than or Equal To
    • Is
    • Not Equal To
    Set a comparison value.
    For rules of type:
    • Not Between
    • Range
    Set lower and higher range limits.

    If required, activate Include Value in Range to specify that the limits should be included in the comparison range.

  4. In the Error Message field, type an error message that should appear for site users when the answer is invalid.