Error: ReCAPTCHA placeholder element must be empty

后端 未结 4 1308
执念已碎
执念已碎 2021-02-11 12:38

I am using recaptcha with my laravel application.

I just want to check recaptcha\'s response on form submit using jquery and stop user by alert that pleade validate capt

相关标签:
4条回答
  • 2021-02-11 12:58

    You are loading the google recaptcha library twice.

    https://www.google.com/recaptcha/api.js

    0 讨论(0)
  • 2021-02-11 13:06

    I got this error when I tried to render reCaptcha on non empty element

    <div class="g-recaptcha"  data-sitekey="{{ env('GOOGLE_RECAPTCHA_SITE_KEY') }}">
          <div class="form-group">some element inside reCaptcha container</div>
    </div>
    

    reCaptcha placeholder element must be empty

    <div class="g-recaptcha"  data-sitekey="{{ env('GOOGLE_RECAPTCHA_SITE_KEY') }}"></div>
    
    0 讨论(0)
  • 2021-02-11 13:17

    You are loading the library 2 times

    chose

    <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
    

    or

         <script src="https://www.google.com/recaptcha/api.js" async defer></script>
    
    0 讨论(0)
  • 2021-02-11 13:18

    I am using ContactForm7 for Wordpress, which has a built-in integration with Recaptcha. I also have the BWP Recaptcha plugin, which uses the same recaptcha libraries. I had mistakenly added my activation keys to both, which was causing the js library to load twice. Once I removed the keys from the CF7 plugin the error went away.

    0 讨论(0)
提交回复
热议问题