Define a validation rule for Date/Time and Date of birth questions

Date/Time questions have multiple validation rules available to allow site users to enter only certain dates in time.

When setting validation rules, age questions have the particullarity 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 age value, see Define a validation rule for number and age 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 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 as described in Access the rules section.
  2. Click Add Validation Rule and select one of the validation rules available:
    Validation rule type Description
    After A site user must enter a date that comes after the specified date.
    On or After A site user must enter either the exact same date or one that comes after the specified date.
    Before A site user must enter a date that comes before the specified date.
    On or Before A site user must enter either the exact same date or one that comes before the specified date.
    On A site user must enter the exact same date as the one specified.
    Not On A site user must not enter the exact same date as the one specified.
    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 Date of Birth from the Add Validation Rule drop-down. In these cases, the box is titled Date Rule.
    A Validation Rule box appears below the Add Validation Rule button 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:
    • After
    • On or After
    • Before
    • On or Before
    • On
    • Not On
    Set a comparison date.
    For rules of type:
    • Not Between
    • Range
    Set lower and higher date range limits.
  4. In the Error Message field, type an error message that should appear for site users when the answer is invalid.