Note: This tag is currently incompatible with the Flex theme.
The system places an error icon, or flag, next to all of the question(s) used in the validation expression when the condition is false. These appear alongside the message at the top of the page and are used to direct the respondent's attention to the error. Placement and display of the error flags can be customized, as detailed below.
Relocating the error flag to a different question
In the case of multi-question complex validations, IntelliSurvey places a flag adjacent to each question. It does this because it cannot determine from the expression which question is the culprit of failing the validating expression. Sometimes this can be confusing to the respondent. To mitigate this confusion, use the flag
tag.
Syntax
# Flag appears next to single question flag: Question ID # Flag appears next to multiple questions flag: Question ID 1, Question ID 2
Example
Display flag at multiple questions
In the example below, the error flag is placed on both Q1 and Q2 when the validation expression is false. Each question ID should be separated by a comma.
validate: $Q1 > 0 message: Please enter a value flag: Q1,Q2
Display flag at single question
In this example, two questions have been used in the expression, but the flag only appears on one of them. Note the lack of quotes around Q3.
Note: Do not prefix question labels with a sigil ($): this is reserved for custom variables, described below. The system will warn if the input to the flag tag is identical to a survey field and is prefixed with a sigil.
Relocating the error flag with a custom variable
To create a custom location for the error flag, create a custom validation flag variable and reference that variable on the page. The custom variable is not available in the reports and is only used for relocating the error flag.
Syntax
# Reference, place on page where error flag should appear $QCUSTOM_VALIDATE validate: Validate condition message: Message to display if validation failed flag: $QCUSTOM_VALIDATE
Example
In the example below, the flag variable is defined as '$Q4FLAG' and is inserted at the end of the question text. To trigger the validation, either enter '0' for the first three rows, or leave them blank.
Using the error flag in validation messages
In the message
tag of any validation, {[icon]}
can be included to insert the error flag in a specific place in the message text, as shown below.
When defining the validation message for local validates or re-defining the validation message for system validates, it is possible to put the error flag image within the text of the validate.
Syntax
message: Message text; {[icon]} more message text.
Example
In this example, select a number and then click continue without answering the textbox to trigger the validation.
Comments
0 comments
Please sign in to leave a comment.