click next button JS no longer working | XM Community
Skip to main content

I used to use the following javascript successfully to both 1. hide the next button and 2. go to the next question after 6 seconds. I am trying to use it now, and it does not work (the next button is hidden, but the question never advances). Can anyone help me to revise the javascript so it works?

 

Qualtrics.SurveyEngine.addOnload(function(){
this.hideNextButton();
var that = this;
(function(){that.clickNextButton();}).delay(6);
});

@MichaelJSerra 
Try this, let me know if it helps

Qualtrics.SurveyEngine.addOnReady(function()
{
this.hideNextButton();
setTimeout(function () {
jQuery("#NextButton").click();
}, 6000);
});


 


Thanks for the help! Unfortunately, same problem: it hides the next button, but never advances.


I asked chatgpt for help and it gave me this:

 

Qualtrics.SurveyEngine.addOnload(function() {
    this.hideNextButton();
    var that = this;
    setTimeout(function() {
        that.clickNextButton();
    }, 6000);
});

 

This works, but the delay is quite inconsistent. I have been timing it, and it can take 7-10 seconds to show the next item. Yes, I tried shortening the delay in the code, but the variance in the actual delay is just… not what I need here. I need it to be reasonably close to 6 seconds, and consistent.

 


Thanks for the help! Unfortunately, same problem: it hides the next button, but never advances.

It worked for me :))

I asked chatgpt for help and it gave me this:

 

Qualtrics.SurveyEngine.addOnload(function() {
    this.hideNextButton();
    var that = this;
    setTimeout(function() {
        that.clickNextButton();
    }, 6000);
});

 

This works, but the delay is quite inconsistent. I have been timing it, and it can take 7-10 seconds to show the next item. Yes, I tried shortening the delay in the code, but the variance in the actual delay is just… not what I need here. I need it to be reasonably close to 6 seconds, and consistent.

 

Have you try put this on Qualtrics.SurveyEngine.addOnready


Doesn’t work for me under surveyengine either.


 

Qualtrics.SurveyEngine.addOnReady(function()
{
this.hideNextButton();
setTimeout(function () {
jQuery("#NextButton").click();
}, 6000);
});

 

Kinda strange, I use my line of code on a page with a timing question and got 6 seconds all the time

Try again with my code, press the Red Clear button and just paste mine in & Save.


I asked chatgpt for help and it gave me this:

 

Qualtrics.SurveyEngine.addOnload(function() {
    this.hideNextButton();
    var that = this;
    setTimeout(function() {
        that.clickNextButton();
    }, 6000);
});

 

This works, but the delay is quite inconsistent. I have been timing it, and it can take 7-10 seconds to show the next item. Yes, I tried shortening the delay in the code, but the variance in the actual delay is just… not what I need here. I need it to be reasonably close to 6 seconds, and consistent.

 

Did the same test with your code, 6 seconds all the time


Leave a Reply