0

When I submit the form with Invalid input and try to resubmit form. then it show the Error ["timeout-or-duplicate"]. I want to reset the recaptcha without to reload the page.
I tried with grecaptcha.reset(). But it does not work for me. Can anyone help me?

3 Answers 3

1

I had the same issue but I fixed it. The javascript code that you have pasted in your front-end file (HTML file), should ONLY be executed when the entire HTML page completes loading. In Javascript we say when the DOM is ready -

So, in vanilla javascript you can use code similar to -

document.addEventListener("DOMContentLoaded", function(){
  // Handler when the DOM is fully loaded
  // Google recaptcha V3 Javascript code should be here 
});

Or, if you are using jQuery -

$(document).ready(function() {
   // Handler when the DOM is fully loaded
   // Google recaptcha V3 Javascript code should be here 
});

Hope this will fix the issue.

0

Check if your form is double submitted. Here is a jQuery code where you can see how to prevent the form from duplicationg the submit.

0

We have debugging this for some time now and I looks like the recaptcha expires after some time, our problem is that we trigger the execute() on load and it seems to expire then if the user wait about 3 minutes before sending the form. Will investigate this further..

What I can see is this a problem in the frontend, it's not a backend problem. We have checked that we just verify the recaptcha one in the backend so it's expires from the time we render the form to we check it in the backend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.