EWZRecaptchaBundle icon indicating copy to clipboard operation
EWZRecaptchaBundle copied to clipboard

Having multiple forms with V3 recaptcha overwrites global js variables

Open FluffyDiscord opened this issue 3 years ago • 0 comments

I have multiple forms on page that use V3 validation. The issue is, that for every form, the widget outputs <script> which contains globally defined variables such as grecaptchaInput or grecaptchaForm which are being overwritten with each new form in page.

The solution is either use local vars, such as let or const or add random prefix to them when generating the widget script.

FluffyDiscord avatar Apr 19 '22 11:04 FluffyDiscord