Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter fants404

    (@fants404)

    I’ve been able to resolve the issue by using Popup Maker instead of a dynamically loaded popup method. Since Popup Maker uses inline content rather than AJAX to display the form, the reCAPTCHA script now initializes correctly within the popup, and everything is working as expected.

    I appreciate your support in helping me understand how the script and callback function operate behind the scenes.

    Thanks again for your assistance!

    Thread Starter fants404

    (@fants404)

    Hello,

    Thanks again for your response and for sharing the links to the core files.

    I understand now that the reCAPTCHA for Contact Form 7 is initialized using a recaptchaCallback JavaScript function, and that this is triggered through the Google API script loaded by the plugin.

    Since my form is inside a dynamically loaded popup, it makes sense that this callback isn’t triggered when the form appears.

    I’ll explore the possibility of calling or adapting the recaptchaCallback function manually when the popup opens. If you have any quick guidance or code example on how exactly to trigger this callback after the popup is displayed, that would be greatly appreciated.

    Thanks again for pointing me in the right direction.

    Thread Starter fants404

    (@fants404)

    Thank you for your detailed response and for providing the code to enqueue the reCAPTCHA script globally.

    However, I’d like to clarify that I have already tried using the code you suggested:
    function wpcf7_enqueue_recaptcha1748634272() {
    wp_enqueue_script( ‘google-recaptcha’ );
    }
    add_action( ‘wp_enqueue_scripts’, ‘wpcf7_enqueue_recaptcha1748634272’, 55 );

    Unfortunately, even with this in place, the reCAPTCHA script still does not load inside the popup. The Contact Form 7 CAPTCHA works fine on a regular page, but when the form is opened within a dynamically loaded popup, the CAPTCHA simply doesn’t appear.

    I understand your point about dynamic content and AJAX possibly interfering with script loading. That said, the popup is triggered using a common popup plugin and the form loads visually just fine—only the CAPTCHA is missing.

    Could you please advise on how to manually trigger or reload the reCAPTCHA when the popup opens? Or is there any recommended way to ensure Contact Form 7 and reCAPTCHA work correctly in a dynamically loaded popup environment?

    Thread Starter fants404

    (@fants404)

    There seems to be a misunderstanding. The Contact Form 7 CAPTCHA is functioning correctly on a standard page, but it does not work when the form is displayed within a popup.
    The ‘Get a Quote’ button triggers a popup that contains a Contact Form 7 form. While the form loads correctly, the CAPTCHA does not appear within the popup.

Viewing 4 replies - 1 through 4 (of 4 total)