• All good, but today I’ve added some WPBakery Tabs block with buttons and have a lot of errors about not existing contact form when click the tab buttons. So I’ve fixed your script to enable captcha on form focus, now it really works only at CF7. Please replace your existing CF7 script function to my one:

    function cf7ic_toggle()
    {
        echo '<script type="text/javascript">
            document.addEventListener("focusin", cf7ic_display);
    
            function cf7ic_display(event){
                if(event.target.form && event.target.form.querySelector(".cf7ic-toggle")) {
                    event.target.form.querySelector(".captcha-image").style.display = "block";
                }
            }
    
            document.addEventListener( "wpcf7mailsent", function( event ) {
                if (event.target.querySelector(".captcha-image")) {
                    event.target.querySelector(".captcha-image").style.display = "none";
                    document.activeElement.blur();
                }
            }, false );
        </script>';
    }
    
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this review.