I have lots of JavaScript in my survey that does some work, sets some embedded data fields and then auto advances to the next question using jQuery("#NextButton").click(); This all works great until I turn on Bot Detection using reCAPTCHA on my Survey Options. Then all of sudden my JavaScript clicks stop working. No errors are posted in the browser console.
I've tried this.clickNextButton() also with no success.
Any ideas?
Thanks!
-Dave
Solved
Turning on Bot Detection (reCAPTCHA) causes jQuery("#NextButton").click(); to stop working.
Best answer by TomG
It is probably a timing issue (i.e., the next button isn't loaded when you are trying to click it). Two things:
- Try moving your script that clicks the next button from addOnload to addOnReady.
- When using this.clickNextButton() make sure 'this' refers to the question object (i.e., 'this' no longer refers to the question object inside another function). Assign 'this' to a variable at the top of the script, then use the variable (e.g.,
var qobj = this;
then laterqobj.clickNextButton();
)
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.