grecaptcha.reset() / render() javascript errors

9,184 views
Skip to first unread message

digitaldanuk

unread,
Dec 19, 2014, 6:10:13 AM12/19/14
to reca...@googlegroups.com
Any thoughts on this would be really helpful. Same issue posted in StackOverflow doesn't seem to get a response:

I am trying to get Google Recaptcha to work on one of my sites but I am facing some problems. I am following the documentation here and using the explicit render function to create the recaptcha widget.

The form that contains the captcha can be reused without reloading the page. In other words, when someone successfully submits the form for the first time, it collapses and a button is shown that allows users to use the form again.

When this button is clicked I call the reset function in JS to make the captcha work again. The details of this function can be found here. When the reset function is called, this error appears in the console;

Error: Permission denied to access property '10_1417377045946'

After that when someone tries to use the captcha the following error pops up:

The page at http:// google.com says: An error occurred while contacting the recaptcha service.

Can someone please help me find a solution to this issue? Thanks



http://stackoverflow.com/questions/27217778/google-recaptcha-throwing-errors-on-reset


Gary Kennedy

unread,
Feb 25, 2015, 12:07:25 AM2/25/15
to reca...@googlegroups.com
Same problem here. I found the stackoverflow question first and the given answer does not work for me. After resetting a 'used' recaptcha widget I still get that error. The only thing the given solution does is delay showing the recaptcha for 1/2 second (which is not good UX)

Cheer,
Gary

Travis Lawrie

unread,
Feb 25, 2015, 1:25:03 AM2/25/15
to reca...@googlegroups.com
this is what i do, to reset recaptcha (v2.0 api) and avoid some similar issues i was having with angular ajax http POSTs

 var resetRecaptcha = function () {
            $('.pls-container').remove();
            grecaptcha.reset();
        };

and call resetRecaptcha(); when you want to reset it.

Though.. this hack is bad. its bad because google can update api.js in the future that changes the way recaptcha 2.0 renders and potentially causing this fix to no longer work

--
You received this message because you are subscribed to the Google Groups "reCAPTCHA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to recaptcha+...@googlegroups.com.
To post to this group, send email to reca...@googlegroups.com.
Visit this group at http://groups.google.com/group/recaptcha.
For more options, visit https://groups.google.com/d/optout.

Gary Kennedy

unread,
Feb 25, 2015, 6:25:15 PM2/25/15
to reca...@googlegroups.com
Thank you for that Meruem. It works perfectly and I am now very happy :)

Cheers,
Gary
Reply all
Reply to author
Forward
0 new messages