Hi everyone,
I found this code to advance by pressing "enter", and wrote it on specific questions.
But after the first time the subject press Enter to move forward, in all questions s.he can move forward by Enter. Even when I do not want the subject to be able to proceed in this way, and the code is not written there.
Maybe someone knows how to deal with it?
many thanks!
Qualtrics.SurveyEngine.addOnload(function() {
var qid = this.questionId;
document.onkeydown = function(event) {
console.log('keydown',event);
if (event.which == 13) {
event.preventDefault();
jQuery('#NextButton').click();
}
}
});
Solved
How to run code on only some of the questions?
Best answer by TomG
It stays active across pages because you attached it to the document. If you set up the event with addEventListener() or jQuery on() then you can remove the event in the addOnUnload() function with removeEventListener() or jQuery off().
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
