Follow

Validation

→ for all Question and Matrix types

This feature may be used to validate responses given are appropriate. For instance, validating that numerical responses are provided or correct email address or to avoid illogical combination of answers within one multiple choice question.

If the respondents answer does not meet the validation requirement then an error message will be displayed to the respondent. Answers that fail validation will prevent the respondent from proceeding to the next page.

  1. To validate responses, click on the option icon on the far right-hand side of the element you want to edit and Options with optional tick boxes will appear below
  2. Select the tick box [Validation]
  3. A field will appear, similar to that below, with 2 entry fields for entering the validation check and writing a display message that you want to appear if the respondent's answer is not valid.


  4. To enter the validation, it will need to be written as an 'expression'. For details on how to write an expression with the appropriate syntax, go to the section Expressions.

Examples:

  1. Validate email address
    • Question: Please provide your email address
    • Validation expression (Regex): $email_address=~/@/
    • Error Text: “Please check your email format: myemail@address.com”

  2. Validate postcode
    • Question: My postcode is:
    • Validation expression (Regex): ($postcode=~/^[0-9]+$/)
    • Error Text: “Only numbers allowed”

  3. Validate logical combination of answers within one multiple choice question
    • Question: Which of these describe your current living arrangements? Tick all that apply.
    • Answers:
      • I live alone
      • I live with my spouse/partner
      • I live with my children
      • I live with my parent(s)
      • I live with my sibling(s)
      • I live with other adult family members
      • I live with other adults (not family members)
    • Validation: !($living_1==2 && $living_2==2 || $living_1==2 && $living_3==2 || $living_1==2 && $living_4==2 || $living_1==2 && $living_5==2 || $living_1==2 && $living_6==2 || $living_1==2 && $living_7==2)
    • Error Text: “Please review your selection above”

Attachments
:
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.