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

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

  • 25 September 2020
  • 1 reply
  • 16 views

Userlevel 2
Badge +6
  • Level 2 ●●
  • 11 replies

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

Userlevel 4
Badge +4

I think what you need is Force Response.

Leave a Reply