```
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
/*Advance on enter - modified from the following gist: */
/*https://gist.github.com/mattbloomfield/de3a20a5180c274f79e7dfcaeb35ea66*/
var qid = this.questionId;
document.onkeydown = function(event) {
console.log('keydown',event);
if (event.which == 13) {
event.preventDefault();
jQuery('#NextButton').click();
}
}
});
```
I want to delay the page advance for 3 seconds, which I'm currently doing through a timing question and enabling submit after 3 seconds.
However, I've noticed while testing that hitting the enter key can jump ahead before the 3 seconds are finished (when the next button is displayed). Does anyone know what the right way to incorporate this delay into the Javascript?
Best answer by fleb
View original