Hello! How can we help?

Search our knowledge base for loads of useful advice and answers to common questions

If you're still stuck you can always submit a support request and we'll get back to you ASAP

Adding validation rules to a single line text answer component

Ceri Daniels -

Citizen Space allows you to specify that any text entered in a single line text field by a respondent must match one or more pre-defined words or phrases. If the question has been answered, it checks the respondent's answer against the valid answer(s) you've specified and halts progress in your consultation to those whose answer doesn't match, as well as displaying a message that lets them know why they're unable to progress.

This could be useful if, for example, you want to create a quiz which stops anyone who has answered a question incorrectly from progressing any further. You could enter the correct answer to each question as a validation rule and set up a validation message that lets them know they haven't got the answer right.

 

How to add validation rules to a single line text answer component

To add a validation rule to a single line text answer component, add the component as you usually would including the accessibility label and reporting field heading, then 'Add component'.

Once the component has been created, you'll see three options above the accessibility label: 'Delete', 'Edit component' and 'Validation rules'. Select 'Validation rules'.

 

Validation_rules_1.png

Enter the valid answer(s) to your question in the 'Validation options' box. If you'd like to add multiple valid answers to the same question you can, just be sure to enter one answer per line.

 

Validation_rules_3.png

Respondents must enter the exact same words as your answer for their response to be valid, so if you've entered "Arlen Village" as a validation option and your respondent enters "Arlen", this won't be accepted as a valid answer. 

Any capitalisation will be ignored by Citizen Space, so if you've entered "Arlen Village" as a validation option and your respondent enters "arlen village", this will be accepted by Citizen Space as a valid answer.

Finally, add the message your respondents will see if they enter an incorrect response to the question by adding the text in the 'Validation message' box. Then 'Save Changes'. 

 

Validation_rules_4.png

NB. The validated answer component will stop your respondents from progressing through the consultation if they give an incorrect answer to the question, but it's important to note that it will let them continue if they skip the question altogether. If you'd like to avoid this, you'll need to make your question a 'required' question