Flexible Captcha is not working
-
Flexxible captcha is not working event I add correct captcha value then still it’s it’s give me wrong captcha entered error. I am using with contact form7.
I have added below code also in function.phpadd_filter( ‘wpcf7_form_elements’, ‘custom_wpcf7_form_elements’ );
function custom_wpcf7_form_elements( $form ) {
$form = do_shortcode( $form );
return $form;
}
add_filter(‘wpcf7_validate’, ‘custom_wpcf7_validate’);
function custom_wpcf7_validate($result) {
global $FlexibleCaptcha;
if (!$FlexibleCaptcha->check_captcha_val()) {
$captchaTag = new WPCF7_FormTag(array(‘type’=>’text’, ‘basetype’=>’text’, ‘name’=>’FC_captcha_input’));
$result->invalidate($captchaTag, ‘The entered text did not match the captcha image.’);
}
return $result;
}
add_filter(‘wp_head’, ‘custom_add_contact_captcha_regenerate’);
function custom_add_contact_captcha_regenerate($result) {
?>
<script type=”text/javascript” language=”javascript”>
jQuery(function() {
jQuery(‘.wpcf7-form’).on(‘ajaxComplete’, function() {
jQuery(‘.wpcf7-form .FC_image_refresh’).click();
});
var oldHtml = jQuery(‘.wpcf7-form .FC_captcha_input_container’).html();
jQuery(‘.wpcf7-form .FC_captcha_input_container’).html(‘<span class=”wpcf7-form-control-wrap FC_captcha_input”>’+oldHtml+'</span>’);
});
</script>
<?php
}- This topic was modified 5 years, 3 months ago by .
- This topic was modified 5 years, 3 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘Flexible Captcha is not working’ is closed to new replies.