how to make a check box in kobo that when selected will render an input field
- User
how to make a check box in kobo that when selected will render an input field
- Assistant
You can achieve this behavior in KoboToolbox by using relevance logic. Essentially, you create a checkbox (or multiple‑choice) question, then add an input field (for example, a text question) whose appearance is controlled by a condition that checks whether that checkbox was selected.
Below are the steps using an XLSForm (Excel) as an example:
1. Create the Checkbox Question
Assume you have a question where the respondent can check an option. For instance, let’s name it
reason_checkand let the only choice beother. In yoursurveysheet, it might look like:type name label select_multiple yesno reason_check Do you have another reason? And in your
choicessheet, you define:list_name name label yesno yes Yes yesno no No yesno other Other Note: If you only want a single option to trigger the input field, you might be considering using a select_one question with choices like “Yes” and “No” instead.
2. Create the Input Field That Appears Conditionally
Next, add a question for additional input. For example, an "Other Reason" text field that should appear only when the respondent selects the
otheroption. In yoursurveysheet, add:type name label relevant text other_reason Please specify your reason: selected(${reason_check}, 'other') Here, the key is the relevant column. The expression
selected(${reason_check}, 'other')means that the
other_reasonfield will only be displayed if the respondent selected theotheroption within thereason_checkquestion.
3. How It Works
-
When the Condition Is Met:
If the respondent selects “Other” (i.e., theothervalue) in thereason_checkquestion, the relevance logic (selected(${reason_check}, 'other')) evaluates to true, and theother_reasontext field is displayed. -
When the Condition Is Not Met:
If “Other” is not selected, the text input field (other_reason) remains hidden.
4. Notes When Using the KoboToolbox Form Builder
If you’re using the KoboToolbox Form Builder (web interface):
-
Add the Checkbox Question:
- Drag and drop a question type that fits your need (e.g., "Select one" or "Select multiple").
- Configure its options.
-
Add the Input Field:
- Create a new field (e.g., text input).
-
Set Up the Relevance:
- In the input field’s settings, find the “Relevance” or “Condition” setting.
- Enter an expression similar to:
selected(${reason_check}, 'other') - This tells KoboToolbox to show the field only when the respondent has selected “Other” in the checkbox question.
-
Test Your Form:
- Use the preview function in KoboToolbox to ensure the input field appears only under the desired condition.
With these steps, you’ll have a KoboToolbox form where selecting a checkbox option dynamically renders or hides an associated input field.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.