dropdown->text entry | XM Community
Question

dropdown->text entry


Userlevel 2
Badge +3
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?
!

3 replies

Userlevel 5
Badge +6
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;}
Userlevel 5
Badge +24

@Cathaya ,

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. 

Userlevel 7
Badge +27

The functionality is In-Page Display Logic.

Leave a Reply