I am currently trying to add reCAPTCHA on the client side and I have followed the documentation accordingly from both Google and reCAPTCHA's website. However, for some reason I keep getting this error message:

I've placed my script tag in the head and my reCAPTCHA div just before the closing form tag.
<!-- Google reCAPTCHA API -->
<script src='https://www.google.com/recaptcha/api.js' async defer> </script>
<form action="URL: https://www.google.com/recaptcha/api/siteverify" method="POST"> -->
<!-- reCAPTCHA Widget Appears Here -->
<div class="g-recaptcha" data-theme="darklight" data-sitekey="my_public_sitekey"></div> -->
</form>
Please let me know if you need to see more of my code. From what I've read in other forums people had to disable domain name validation, however, that causes issues with verification.
Any help is much appreciated. Thanks!
After hours and days of research I've finally found a solution. This error is actually a reCAPTCHA issue that still has not been fixed. You can work around their protocol issues and disable domain check in advance settings. However, that can potentially mess up the validation process.
Initially I was testing this locally file:///users/file-path-to-my-file. Finally last night I found out you cannot use reCAPTCHA this way. I ended up testing my site publicly and now it works just fine. Hope this helps someone!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With