Hi community, I have two questions in my survey, one pick/group/rank question (Q1) and a multiple choice question (Q2).
In the pick/group/rank question (Q1), I need to set the number of items that must be placed in each group (e.g., in the first group, 1 item; in the second group, 2 items). Since qualtrics does not provide a function to do that, I need to use some javascripts. The javascripts disable the “next” button until a set number of issues is placed in each box. And the javascripts work well for this question.
The next question is a multiple choice question (Q2). It belongs to a new question block, and does not have javascripts. However, for this question, the “next” button disappears after a single click on the page and does not reappear (so i cannot move to the next page). This “next” button does not disappear if I take out the javascripts from the previous pick/group/rank question (Q1), so I think this means the javascripts from the previous one (Q1) are affecting this one (Q2). Could you help me figure out why and how to let the “next” button not disappear for Q2? Thank you very much!
Below is the javascript for Q1:
Qualtrics.SurveyEngine.addOnload(function()
{
});
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
that = this;
that.hideNextButton ();
document.addEventListener('mouseup',()=>{
var group1=jQuery("#"+that.questionId+"group0 li").length;
var group2=jQuery("#"+that.questionId+"group1 li").length;
var group3=jQuery("#"+that.questionId+"group2 li").length;
var group4=jQuery("#"+that.questionId+"group3 li").length;
var group5=jQuery("#"+that.questionId+"group4 li").length;
var group6=jQuery("#"+that.questionId+"group5 li").length;
var group7=jQuery("#"+that.questionId+"group6 li").length;
if(group1 == "1" && group2=="2" && group3=="3" && group4=="4" && group5=="3" && group6=="2" && group7=="1")
{that.showNextButton ();}
else {that.hideNextButton ();}
}
)
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});