Use this command to display a Checkbox on the interview.
Examples of usage:
The command can be written as simply as this, and when the data element is chosen its value will be ‘true’ and when not chosen, an empty string. For example:
«When(Beneficiary = “true”,yes,no)»
The command is quite customizable, so another variation could be:
«When(Beneficiary = “Y”,is a beneficiary,is not a beneficiary)»
In this case the values are as follows:
Y is the value when the checkbox is checked
The first N is the value when the checkbox is unchecked
And the second N is the default value of the checkbox.
Where this default value is not specified (as in
«ChooseUsingCheckBox(AttendSchool,Yes,No)») or is specified but is neither the value when checked nor the value when unchecked (e.g.
«ChooseUsingCheckBox(AttendSchool,Yes,No,Don't Know)»)) then the checkbox is first shown in the indeterminate state – i.e. neither checked nor unchecked.
By default, captions are on the left hand side of checkboxes. It might be more desirable to place the captions on the right hand side with this trick:
«ChooseUsingCheckbox(IsBeneficiary,Y~~The child is a beneficiary,N,N)»
Instead of your checkbox looking like this:
It would look like this:
Change the caption dynamically:
It is possible to include data elements in captions, so as to bring some context to the interview. Read more about that concept here:
Here is an example using the script technique, which will include the values captured by the user, in the caption of checkbox.
«ChooseUsingCheckbox(IsBeneficiary,Y~~<ChildName()||Name> is a beneficiary,N,N)»