How can I make Google's No CAPTCHA reCAPTCHA
a required field?
I mean, I want to check it with HTML or JavaScript.
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.
Invoking the reCAPTCHA verification programmatically can be achieved by rendering the challenge in a div with an attribute data-size="invisible" and programmatically calling execute. Create a div with data-size="invisible" . Call grecaptcha. execute from a javascript method.
What you have to do is prevent the form submission until you can validate the user response by using the Google reCaptcha verify callback, then, if it passes, allow the form to submit. See this answer: Google ReCAPTCHA how to make required? and also check the documentation: https://developers.google.com/recaptcha/docs/display#example
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