Hey guys,
i have a checkbox with different possible answers. I would like to skip to another question (not the following), if only one answer of the checkbox was chosen.
This did not work out with "if length = 1", maybe because every selection from 0 to 9 has the length of 1?
Thanks for your hepling hand!
One answer checkbox
Re: One answer checkbox
Length will give you the maximum length of the field, including the blank space, which does not indicate how many options were checked. However, you can use strip() to remove the blank space to determine the length of the non-blank part which will be the same as the number of options that were checked. So rather than use .
Code: Select all
length(MYCHECKBOXFIELD) = 1
Code: Select all
length(strip(MYCHECKBOXFIELD)) = 1
Re: One answer checkbox
Hey, I have another question concerning the checkbox.
If I have a list of different activities and the last option is "None of them"...
If the respondent chooses the option "None of them", I would like to get all the other possible options "blocked", so that another choice is not possible anymore.
If I have a list of different activities and the last option is "None of them"...
If the respondent chooses the option "None of them", I would like to get all the other possible options "blocked", so that another choice is not possible anymore.
Re: One answer checkbox
In logic don't let the interviewer advance if none and an another option are both selected. I've attached an example application.
- Attachments
-
- Checkbox.zip
- (2.72 KiB) Downloaded 189 times
Re: One answer checkbox
Thank you, but what did you do to not show the different options in the questionnaire again?
Re: One answer checkbox
You can't disable them. My workaround was to not let the CAPI application move forward, if none + another option are selected. Take a look at the example application. The relevant logic is:
if TOILET_OPTION_NONE and (TOILET_OPTION_1 or TOILET_OPTION_2 or TOILET_OPTION_3) then
errmsg("If none is selected, then another option cannot be selected.");
reenter;
endif;
errmsg("If none is selected, then another option cannot be selected.");
reenter;
endif;