Count the number of selected options in a Matrix table before submit | XM Community
Skip to main content
Question

Count the number of selected options in a Matrix table before submit

  • September 25, 2020
  • 1 reply
  • 35 views

Forum|alt.badge.img+6
  • Level 2 ●●

Hi,
I have a matrix question, with 9 statements and 2 options for each statement (they can only choose one option for each statement).
I want to hide the Next button, till they make a selection for all statements.
I have the following code and sometimes it works (when they click the left option on all 9 statements) but it does not work for other selections. Any help on how to implement this correctly?
var QID = this.questionId ;
jQuery("#" + QID + " input[type='radio']").on("click", function() {
var cnum = 0;
jQuery("#" + QID + " input[type='radio']:checked").each(function(){
cnum=cnum + 1;
jQuery("#"+this.questionId+" .QuestionText").append(cnum);
});
if(cnum == 9){
jQuery("#NextButton").show();
}
else
jQuery("#NextButton").hide();
});

1 reply

npetrov937
Level 2 ●●
Forum|alt.badge.img+4
  • Level 2 ●●
  • September 29, 2020

I think what you need is Force Response.