karser / KarserRecaptcha3Bundle

Google ReCAPTCHA v3 for Symfony
MIT License
158 stars 21 forks source link

Triggering captcha on form submit #54

Closed stingus closed 2 years ago

stingus commented 2 years ago

Hi, Not sure how to implement the following behavior: I don't want the captcha dialog to open up in page load, but when the user submits the form. The twig widget loads the recaptcha js and automatically calls the recaptchaCallback_form_captcha, thus opening up the captcha dialog.

<script src="https://www.google.com/recaptcha/api.js?render=<YOUR-RECAPTCHA-KEY>&onload=recaptchaCallback_form_captcha" async defer></script>

I don't know how to interpret your example , under or on form post. The captcha is already triggered on page load.

Thanks!

stingus commented 2 years ago

My bad, I was using a v2 key which triggered the captcha dialog on page load.