Define a validation rule for Date/Time questions

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

  1. For a given Date/Time question, go to the Rules side panel as described in Access the Rules section.
  2. On the Rules side panel, select Add Rule
  3. From the drop-down, select 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 container for the given Validation Rule is listed in the Rules side panel. You configure the rule definition in this container.
  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. Configure the Validation and Create a Query toggles.
    • Enable the Validation toggle to evaluate and accept a provided answer only if it meets the rule condition. If it does not, this configuration blocks the user from carrying out the Randomization and Trial Supply Management (RTSM) actions (randomization, dispensation, and screening) until the question is changed to a value that meets the validation criteria.
    • Enable the Create a Query toggle to instruct the system to raise a query when the answer provided does not meet the criteria. This configuration does not prevent the user from processing RTSM actions.
    • Enable both the Validation and Create a Query toggles to evaluate and accept a provided answer only if it meets the rule condition and to raise a query if it does not. If the rule conditions are not met, RTSM actions are blocked, but the user can resolve the validation error either by data update or by closing the query, allowing the RTSM actions to proceed.
    For more information see About validation rules.
  6. In the Error/Query Message field, enter an error message to display when the answer does not meet the criteria.
    The error message appears for site users as a floating dialog when an answer is missing or does not meet the criteria. For rules that are configured to trigger a query, this message is included as the query text.
  7. Click Save or Save and Close to save the form changes.
You can define more than one validation rule for a date/time question, if applicable. Repeat these steps to add new rules as required and 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.
For more information see About multiple validations.