XForms Module Validation Logic

This is used to create rules that determine the range of values valid as answers for a question. An example could be setting weight to be between 0 and 250, Last name should not be more than 20 characters, Encounter date should not be after today, and more.

You start by selecting, in the Forms Pane, the question to be validated with a certain condition or set of conditions. Clicking the "Click here to add new condition" link enables you to add as many conditions as you want.
If you have more than one condition, you can combine them with "all", "any", "none", or "not all" operators.
You can delete a condition by selecting the "Delete Condition" item from the menu that pops up after clicking the "<>" link on the left hand side of the condition. From this same pop up menu, you can select the "Add Condition" item to add another condition.
For each condition, you select: the operator, and value to be tested against. The operator list varies according to the question data type.
When you click the dash to enter the value, you can tick/check the "Question value" check box to use the value of some other question instead of a fixed value. This is very use full for cross field validation. For instance when you want to ensure that the answer for height should be less than that for weight.

Resources