Hi All, I have a select_multiple question that I need to add two validation criteria to the question, where I need to prevent selecting two options when one of the below options ( NA or I am not prepared) is selected. Please see the below example to understand my request:
The question is:
How were you prepared?
The options are:
Awareness Session ----- choice name b3_1
Training ----- choice name b3_2
Practices ----- choice name b3_3
Other ----- choice name b3_4
I am not prepared ----- choice name b3_5
NA ----- choice name b3_6
What I need is that when the enumerator selects ( NA or I am not prepared) he will not be able to select any other question. I have used this code ( if(selected(., ‘b3_5’), count-selected(.)=1, count-selected(.)>=1) ) to apply the validation for one of the choices. but how can I write a code to apply for the two choices. Please if you can help me, I would be much appreciated. Thanks in advance!!
Dear @wroos, Thanks a lot for the quick response and the great help you provided. The code you provided worked very well, but it just needs parentheses for the first parameter of the if statement.
if( (selected(., ‘b3_5’) or selected(., ‘b3_6’)), count-selected(.) = 1, count-selected(.) >= 1 ). Thanks again for your support.
Hello @Kal_Lam,
Would you mind to have a look at this, please.
I think, brackets should not be needed for a simple or combination. Maybe this is a hint on a current parser problem?
Thanks in advance anx kind regards.