Does anyone know how to make the "Google ReCAPTCHA (v2)" be "required" in a form
?
I mean no form submission until recaptcha is filled-in?
I use ParsleyJs in my form, but didnt find a way to make it work with div
s...
Does anyone know how to make the "Google ReCAPTCHA (v2)" be "required" in a form
?
I mean no form submission until recaptcha is filled-in?
I use ParsleyJs in my form, but didnt find a way to make it work with div
s...
You have to use the reCaptcha verify response call back. Something like this:
<script src='https://www.google.com/recaptcha/api.js?onload=reCaptchaCallback&render=explicit'></script>
For ParsleyJS you will to do a little workaround:
1.Add hidden input field, with
data-parsley-required="true"
,value = ""
, like this:2.Add error container (just below or under your
g-recaptcha
div):3.Add this simple function somewhere in your js code:
4.Add the attribute
data-callback
with value of custom function: