Set up a validation rule for a question
Create a validation rule for any type of question in a form when you want to verify that entered answers to a specific question meet the study requirements.
Validation rules are useful when you want to block site users from entering unaccepted values for answers to given questions. Depending on the type of question you are working with, different validation rules options are availabe to define.
Question type | Validation rules |
---|---|
Text question |
|
Date/Time and Date of birth questions |
|
Number and Age questions |
|
Drop-down and checkboxes questions |
|
Radio Buttons questions |
|
- 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 further details about how to set validation rules for a specific question type, browse the sections below:
- Define a validation rule for text questions
- Define a validation rule for Date/Time and Date of birth questions
- Define a validation rule for number and age questions
- Define a validation rule for drop-down and checkboxes question
- Define a validation rule for radio buttons questions
Parent topic: Predefined rules
Define a validation rule for text questions
Validation rules for text questions
For text questions, one validation rule is available. The rule limits the field to only alphabetic characters.
- Select Doesn't Contain.
- Enter an Error Message. The error message appears for site users when the answer is missing or invalid.
Parent topic: Set up a validation rule for a question
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.
- 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.
Parent topic: Set up a validation rule for a question
Define a validation rule for number and age questions
Number questions have multiple validation rules available.
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 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.
- 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.
Parent topic: Set up a validation rule for a question
Define a validation rule for drop-down and checkboxes question
For drop-down questions or questions with checkboxes, you can specify the number of options that users must select, or require users to choose a given option. For example, the Select Exactly validation rule is configured for questions that must be used in defining a minimization design or enrollment limit.
- 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.
Parent topic: Set up a validation rule for a question