Hi -
I’ve seen similar questions in the community but have yet to find a satisfactory answer. I’m trying to hide both the text (Please specify) and the text entry box for an MC question. Here’s an example below -
Who helped you move?
A. Parent
B. Friend(s)
C. Spouse
D. Sibling
E. Other (Please specify:) [TEXT ENTRY BOX HERE]
I'd like the "Please specify:" text and the text entry box to only be displayed when option E is selected. Is this possible in Qualtrics?
I have the code to hide the text entry box until that option is selected.
And I can hide the “Please specify” text using this in combination with the html tag
Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#hideable-text").hide();
});
What I can’t figure out is how to show the “Please specify” when the option is selected. I’m sure it’s an easy fix but I don’t know enough JS to figure it out. This is what I’m using to hide the text box. I’m assuming I need to add something to this to show both the box and the “hidden” text.
Any help would be appreciated.
Qualtrics.SurveyEngine.addOnReady(function()
{
var QID= this.questionId;
jQuery("#" + QID + " .InputText ").hide();
jQuery("#" + QID + " input[type='radio']").each(function(){
if(jQuery(this).prop("checked") == true)
{
var v1 = jQuery(this).attr("id");
jQuery("[id*='"+v1+"~TEXT']").show();
}
else
{
var v1 = jQuery(this).attr("id");
jQuery("[id*='"+v1+"~TEXT']").val('');
jQuery("[id*='"+v1+"~TEXT']").hide();
}
});
jQuery("#" + QID + " .Selection ").on("click change",function(){
jQuery("#" + QID + " input[type='radio']").each(function(){
if(jQuery(this).prop("checked") == true)
{
var v1 = jQuery(this).attr("id");
jQuery("[id*='"+v1+"~TEXT']").show();
}
else
{
var v1 = jQuery(this).attr("id");
jQuery("[id*='"+v1+"~TEXT']").val('');
jQuery("[id*='"+v1+"~TEXT']").hide();
}
});
});