For single or multi select question, we can add a text entry to any radio button.
is there is a way to hide it and only show it if the associated button is selected?
Conditionally show Text box
Best answer by rondev
Paste the below code in the JS of the single choice question:
var QID= this.questionId;
jQuery("#" + QID + " .InputText ").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();
}
});
});
For multi choice selection, just change word - 'radio' to 'checkbox' in the above code
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
