Define a validation rule for Date/Time questions

Date/Time questions offer multiple validation rules to restrict site users to only enter specific dates and times.

The answer to an age-related question can be a number (when you're asking a subject to specify their exact age) or a date (when you're asking a subject to specify their date of bith). 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. Go to the Rules sidepanel as described in Access the Rules section.
  2. On the Rules sidepanel, select Add Rule
  3. From the drop-down, select Date of Birth, and choose one of the following validation rules:
    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.
    A Validation Rule dialog appears.
    Screen shot of the settings for a Date/Time validation rule.
  4. Enter values according to the type of validation rule:
    Option Description
    For rules of the following type:
    • After
    • On or After
    • Before
    • On or Before
    • On
    • Not On
    Set a comparison date.
    For rules of the following type:
    • Not Between
    • Range
    Set lower and higher date range limits.
  5. In the Error Message field, enter an error message that should appear for site users when the answer is invalid.