Hey everyone, I have a question I'm hoping someone can help
I have allowed a text box entry for a question with "other" as an option. This is for a multiple choice, single answer question. When I preview the question, the textbox appears under the whole list and I'd only like it to show if someone selects other. Is this possible?
Thanks for your help. :)
Solved
How can I display a text box to a question if someone selects "other"
Best answer by ahmedA
This will work if the last option is the text entry box. See the demo here.
Qualtrics.SurveyEngine.addOnReady(function () {
text_box = this.getChoiceContainer().querySelector(".TextEntryBox");
text_box.hide();
n_choices = this.getChoices().length;
this.questionclick = function (event, element) {
if (element.type == "radio") {
if (element.id.split("~")[2] == n_choices) {
text_box.show();
} else {
text_box.hide();
}
}
};
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
