Hello!
I have a question, Q3, where if the user selects recode value 1, hide Q11 and auto-code Q11 = 7. The problem is, Q11 is a Forced Response and I'm having trouble disabling that. Does anyone know how to disable that with javascript?
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var qid11 = jQuery("#question-QID11");
function checkAndToggle() {
var selectedChoice = jQuery("inputename='QID3']:checked");
if (selectedChoice.length > 0) {
var choiceId = selectedChoice.attr('id');
var recodeValue = choiceId.split('-').pop();
if (recodeValue === '1') {
qid11.hide(); // Hide when recode value is '1'
} else {
qid11.show(); // Show for all other values
}
} else {
qid11.show(); // Show if nothing selected
}
}
checkAndToggle();
jQuery("inputname='QID3']").change(function() {
checkAndToggle();
});
});
Thanks in advance!