check whether any option of a multiple choice question has been selected before page submit | XM Community
Skip to main content

HI!
I am trying to implement a 'custom' force response. I want to know whether any option on the mcq has been selected before they submit the page. I have put together a code using different threads in this forum, but alas can't get it t work. Any obvious mistakes in my code? There are 4 choices for the mcq.
jQuery('#CustomNextButton').on('click', function() {
var ures =this.getChoiceValue
Qualtrics.SurveyEngine.setEmbeddedData("ures", ures);

if (ures =="") {
  jQuery("#QID7").show();
} else {
  jQuery('#NextButton').click();
}

Hello, I just figured out my mistake!
Here is the code if anyone needs it in the future

jQuery('#CustomNextButton').on('click', function() {

if(jQuery("#QID4 input.radio").is(":checked")){

jQuery('#NextButton').click();
} else {
jQuery("#QID7").show();
}


});


Leave a Reply