Validation Logic, or "Data constraints" allow the Form Designer to add rules that are applied to the entered data. If the entered data does not comply with the rules, an pop-up error message is presented to the user, and the user must change the answer to an acceptable entry before being allowed to continue to the next question.
An example of data constraints is requiring that a value fall within a given range. When asking for a respondent's age, the data constraint might only allow answers that are between 18 and 99. Thereby ruling out respondents who are too young (under 18) or whose age is likely an error (over 99).
Data constraints can be applied to any question, and the interface has a series of pop-up dialogues that guide the Designer through setting constraints.
There is a preamble that sets up the logic by declaring "Question *** is valid when:"followed by the Error message, and then the logic.
The Error message is only displayed if the user enters data that does NOT comply with the validation logic.
You can set the Error message text to inform the user how the entered data failed. For example "Age must be between 18 and 99" would be a useful error message.
Next, set the logic in the following steps.
When *** of the following apply.
Clicking "all" will show a pop-up with choices.
"all, any, none, not all" Usually, the default "all" is appropriate.
Length will evaluate the number of characters in the input.
Value is the usual choice, and evaluates the mathematical value of the input.
The "is equal to:" element can be changed to a variety of different comparitive evaluations. Each will compare the user's entry to a number provided here.
There are many ways to use this function. For example, when asking the question "What is your age?" if you want to make sure that your respondent is old enough to be interviewed (is an adult) but you don't want the user to be able to enter a nonsense number (like 999 years old), then you can add two evaluations here:
<> Value is greater than or equal to 18
<> Value is less than or equal to 100