Solved
Select only three options in a single question more than once in one page
Hey guys!
I have this code that is to select three options in a multiple choice question, but I noticed that it applies to a WHOLE PAGE instead of just the specific question. What can I do to chaange this code so that it is only for a specific question?
this.questionclick = function(event,element){
var selectedchoice=this.getSelectedChoices();
if(selectedchoice.length==3){
jQuery("#"+ this.questionId +" input:checkbox:not(:checked)" ).attr("disabled", true);
}else{
jQuery("#"+ this.questionId +" input:checkbox:not(:checked)" ).attr("disabled", false);
var lastChecked;
var $checks = jQuery('input:checkbox').click(function(e) {
var numChecked = $checks.filter(':checked').length;
if (numChecked > 3) {
lastChecked.checked = false;
}
lastChecked = this;
});
}
}
Thanks!
Best answer by PeeyushBansal
instead of code select answer range like atleast 1 and no more than 3. Remove this code completely.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

