Go to next question automatically when is endorsed 3 options | XM Community
Skip to main content

Hi,

I have the next doubt. I am creating a multiple question that allows multipe answers like this:

 What I want is to include on this question a JavaScript that able to go to the next question automatically when is selected 3 options. So, in that case, people should not require to endorse more. Is there a way to trigger that when it mets that condition? 

 

@Josang Try including this in your question

Qualtrics.SurveyEngine.addOnReady(function()
{
jQuery("#" + this.questionId + " input").change(function(){

var n= jQuery('input:checked').length;

if(n==3){

jQuery("#NextButton").click();
}

});

});

Hope it helps!


Hi, try adding the below to the OnReady section of the question’s JavaScript. Each time the question is clicked, it checks the number of choices and if it is equal to 3, clicks the next button.

var that=this;

this.questionclick = function(event,element)
{

var selChoices = this.getSelectedChoices();
var checks = selChoices.length;

if (checks === 3) {
that.clickNextButton();
}

}

 


Both ways work!

Thank you!!!

 


Leave a Reply