Needing Javascript to autoadvance after 75 milliseconds while hiding next button | XM Community
Skip to main content

Hello,
I am programming an AMP in which I show three picture quickly and ask participants how they feel.
I used the autoadvance feature Qualtrics provides and used the Javascript below:
Qualtrics.SurveyEngine.addOnload(function()
{
this.hideNextButton();
setTimeout(function () {jQuery('#NextButton').click();},75);
});

I found that page submit doesn't line up with timing I programmed the autoadvance to. For instance, I set the autoadvance at 0.01 seconds and the page submits at 0.2 seconds.

Sought help from Qualtrics Support. Agent said it's due to browser and wifi issues and to seek Javascript help from the community. What are your thoughts and suggestions to align autoadvance with page submit?

Actually 75 milliseconds too small.
I tried like below and it is working every time. Just a small edit.
this.hideNextButton();
  setTimeout(function () {jQuery('#NextButton').show();
  jQuery('#NextButton').click();
  },75);


Leave a Reply