Site icon Puneet Sharma – Freelance Web Developer

How do you get a Captcha Validation error with Google ReCaptcha?

How to prevent form from submission if user has not gone through Google ReCapcha ?

jQuery(document).ready(function(j){
jQ('#formid').submit(function(e) {
var recaptcha = j("#g-recaptcha-response").val();
if ( recaptcha === "" ) {
e.preventDefault();
alert("Please check the recaptcha");
}
});
});
Exit mobile version