https://www.qualtrics.com/community/discussion/comment/14681#Comment_14681Hi, TomG, may i ask a follow-up question? I notice that if people finish the questions earlier and click the next button by themselves to proceed to next block earlier, these commands still work and make people proceed to the third block. How can I prevent this? Thanks!
https://www.qualtrics.com/community/discussion/comment/38051#Comment_38051So, the code provided by the OP is using prototypejs which I wouldn't use myself. I would use setTimeout. If you record it to a variable they you can use clearTimeout to cancel it. Something like:
var to = setTimeout(function() { that.clickNextButton(); },5000);
Qualtrics.SurveyEngine.onPageSubmit(function() { clearTimeout(to); });
https://www.qualtrics.com/community/discussion/comment/38055#Comment_38055Thanks for the reply. My case is a bit more complex. I paste my code here:
var timeout = setTimeout(function (){jQuery("#NextButton").click();}, 20000);
jQuery('#SvcButton').on('click', () => {
jQuery("#NextButton").click();
clearTimeout(timeout);});
I use the clearTimeout function if another button (SvcButton) is clicked (people will advance to next block so the nextbutton click function should be cleared), but it seems like the settimeout function still works. How can i solve this problem?
My idea was to create a customised next button for this block so that even if the settimeout function still works, it will not click next block's next button. But do you have any other solution or do you know how can i change the scripts? Many thanks!!
https://www.qualtrics.com/community/discussion/comment/38055#Comment_38055I tried several times:
var Q119 = setTimeout(function(){jQuery("#QID119").show();}, 20000);
var Advance = setTimeout(function (){jQuery("#NextButton").click()}, 30000);
jQuery('#SvcButton').on('click', () => {
jQuery("#NextButton").click();
clearTimeout(Q119);
clearTimeout(Advance);
});
It works for var Q119 but it does not work for Advance, the next button in the following block will still be clicked and proceed to the third block. Do you know where is the problem? Thanks!!!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.