Sterup Design

Support

Support forum for my wordpress plugins. Here you can get support for Plugin Organizer, Honeypot Toolkit, and Flexible Captcha.

Please or Register to create posts and topics.

Captcha is not working with contact form 7

Quote from tyagisaurabh on December 16, 2019, 5:53 am

Hi Support,

I am facing an issuo of one of my website 

https://gbxdev.wpengine.com/contact-us/

I am typing correct catpcha it's still give me error

I have added below code also in function.php

   add_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
}

 


Hi Support,

I am facing an issuo of one of my website 

https://gbxdev.wpengine.com/contact-us/

I am typing correct catpcha it's still give me error

I have added below code also in function.php

   add_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
}

 

Uploaded files:
Quote from tyagisaurabh on December 16, 2019, 9:22 pm

Hi Support ,

Please help me to resolve it


Hi Support ,

Please help me to resolve it

Post Reply: Captcha is not working with contact form 7
Exit mobile version