Hi all.
I have a checkbox question that has three choices with text entry. This question is regarding employee benefits. For the two selections 'paid vacation' and 'paid sick leave', I would like to let the respondents enter # of days with a telepad. For the 'other' option, I would like for them to have the typically keyboard.
The text entry boxes only appear if the answer is selected.
My code and question are below.
var QID= this.questionId;
jQuery("#" + QID + " .InputText ").hide();
jQuery("#" + QID + " input[type='checkbox']").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='checkbox']").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();
}
});
});
});
Checkbox Text Entry Issue
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

Hope it helps!