I'm using Google reCAPTCHA and have been able to add the CAPTCHA component to my page inside a form. But when I submit the form there's no validation taking place to check if the CAPTCHA has been solved.
How do I validate that the CAPTCHA component has been solved when submitting my form? Or, in other words, how do I make my CAPTCHA component required?
About reCAPTCHA reCAPTCHA is a free service from Google that helps protect websites from spam and abuse. A “CAPTCHA” is a turing test to tell human and bots apart. It is easy for humans to solve, but hard for “bots” and other malicious software to figure out.
That means your captcha request didn't send to google properly. Did you see the badge logo on the right-bottom side? If not, you might render your captcha in a wrong way. You can post the code how you render your captcha in your view that I can have more info about your issue. All reactions.
Answer: This can be caused when the reCaptcha public key is correct but the private key is incorrect. Verify that the private key is correct in Administration > Sites & settings and attempt to donate again.
if you want to use the native html5 popups, than here is the solution
JavaScript:
window.onload = function() { var $recaptcha = document.querySelector('#g-recaptcha-response'); if($recaptcha) { $recaptcha.setAttribute("required", "required"); } };
CSS:
#g-recaptcha-response { display: block !important; position: absolute; margin: -78px 0 0 0 !important; width: 302px !important; height: 76px !important; z-index: -999999; opacity: 0; }
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