I want to have a text entry when the respondent select the other in the dropdown list, and ask the respondent to fill in the specific information. What should I do?
!
Page 1 / 1
Hi @Cathaya,
you could create the text question bellow this one, hide it unless the option is selected and show it only if an option with given choice id is selected.
I have following function for this:
function display_next (that, ID, choice){
var qid = "QID" + ID;
var sid = qid + "Separator";
var sep = document.getElementById(sid);
var nextQ = document.getElementById(qid);
var selectedRecode;
that.questionclick = function(event, element) {
selectedRecode = that.getChoiceRecodeValue(that.getSelectedChoices());
if(selectedRecode == choice) {nextQ.style.display = "block";
sep.style.display = "block";}
else{nextQ.style.display = "none";
sep.style.display = "none";}}
}
You'll can call it for example like this: `display_next(this, 13, 1);` The function has to be called from the JavaScript of the multiple choice question (and should be defined either there or for example in your external file with function in case you have some).
The first parameter will be always `this`. The second is id of your text question and the last one an id of the choice with text "other".
You can find the question id in inspector or by temporally adding this code to your text question: `alert(this.questionId);`
Additionally you have to add following CSS to your external CSS to make the question invisible in the beginning:
#QID13{display:none;}
#QID13Separator {display:none;}
you could create the text question bellow this one, hide it unless the option is selected and show it only if an option with given choice id is selected.
I have following function for this:
function display_next (that, ID, choice){
var qid = "QID" + ID;
var sid = qid + "Separator";
var sep = document.getElementById(sid);
var nextQ = document.getElementById(qid);
var selectedRecode;
that.questionclick = function(event, element) {
selectedRecode = that.getChoiceRecodeValue(that.getSelectedChoices());
if(selectedRecode == choice) {nextQ.style.display = "block";
sep.style.display = "block";}
else{nextQ.style.display = "none";
sep.style.display = "none";}}
}
You'll can call it for example like this: `display_next(this, 13, 1);` The function has to be called from the JavaScript of the multiple choice question (and should be defined either there or for example in your external file with function in case you have some).
The first parameter will be always `this`. The second is id of your text question and the last one an id of the choice with text "other".
You can find the question id in inspector or by temporally adding this code to your text question: `alert(this.questionId);`
Additionally you have to add following CSS to your external CSS to make the question invisible in the beginning:
#QID13{display:none;}
#QID13Separator {display:none;}
It’s been a while since you posted this question but Qualtrics now has off the shelf functionality in the survey builder to do what you are trying to do in this inquiry. So, you can mark the answer as accepted, and close the question. If not, and you need more information, let me know.
The functionality is In-Page Display Logic.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.