• There are many errors per second being logged to the JS console on (all) pages on the site in question.

    
    recaptcha__en.js:523 Uncaught Error: reCAPTCHA has already been rendered in this element 
    at Object.t4 [as render] (recaptcha__en.js:523) 
    at HTMLDivElement.<anonymous> (gravityforms.min.js?ver=2.4.12:1) 
    at Function.each (jquery.min.js?ver=1.10.2:4) 
    at init.each (jquery.min.js?ver=1.10.2:4) 
    at renderRecaptcha (gravityforms.min.js?ver=2.4.12:1) 
    at (index):2538 
    

    This is due to the following code block being inserted multiple times on the page

    
    <script type="text/javascript"> 
    ( function( $ ) { 
      $( document ).bind( 'gform_post_render', function() { 
        var gfRecaptchaPoller = setInterval( function() { 
          if( ! window.grecaptcha || ! window.grecaptcha.render ) { 
            return; 
          } 
          renderRecaptcha(); 
          clearInterval( gfRecaptchaPoller ); 
        }, 100 ); 
      } ); 
    } )( jQuery ); 
    </script>
    

    This code is inserted once for each form on the page.

    Looking through the Gravity Forms plugin source, this seems to be generated by the ‘ensure_recaptcha_js’ function at line 253 of class-gf-field-captcha.php.

    I contacted Gravity Forms support and they informed me that:
    The error you’re seeing is the result of embedding the same form more than once in the page. As you know GF doesn’t support embedding the same form multiple times in the same page, and reCAPTCHA doesn’t like that either.
    I can see that you have the Gravity Forms: Multiple Form Instances: by tyxla to workaround the limitation of not being able to embed the same form more than once, but that doesn’t seem to help with reCAPTCHA.

    and to contact the author of the “Gravity Forms: Multiple Form Instances” plugin for assistance.

    Any pointers?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hello chillibyte!
    i had the same bug in my site and finally I’ve solved, the problem is exactly what Gravity form support informed you, you cant use many captcha forms in same page, you need to check where you’re loading the forms that are using captcha and if it’s necessary to make a conditional (via code) for loading the form depends of its function. I could help you via Codeable, here my profile, I can check your site and give you an estimate for helping to solve. https://codeable.io/developers/juan-david-rendon/
    Best Regards!

Viewing 1 replies (of 1 total)
  • The topic ‘JavaScript console errors when reCatptcha enabled’ is closed to new replies.