Quantcast
Channel: Topic Tag: contact-form | WordPress.org
Viewing all articles
Browse latest Browse all 5998

gwidgets on "[Plugin: Contact Form 7] reCaptcha is not validated"

$
0
0

I successfully linked the reCaptcha to my contact form, but it is not validated on submit, so the user can submit without cheking the reCaptcha. I added the following code to script.js to make it work:

var reCaptchaMessage = '<div id="recaptcha-message" class="wpcf7-response-output wpcf7-validation-errors"><span>Please check the reCaptcha </span> <div>';

var recaptcha = $form.find('#g-recaptcha-response');
if(recaptcha) {
if(recaptcha.val().length == 0){
$form.append(reCaptchaMessage);
$form.addClass('invalid');
$form.find('img.ajax-loader').css({ visibility: 'hidden' });
return;
}else{
$form.removeClass('invalid');
$form.find("#recaptcha-message").remove();

}

}

anybody having the same issue?

https://wordpress.org/plugins/contact-form-7/


Viewing all articles
Browse latest Browse all 5998

Trending Articles