Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double GRecaptcha in the same page doesn't work #63

Closed
musaffa opened this issue Sep 2, 2021 · 3 comments · Fixed by #75
Closed

Double GRecaptcha in the same page doesn't work #63

musaffa opened this issue Sep 2, 2021 · 3 comments · Fixed by #75

Comments

@musaffa
Copy link

musaffa commented Sep 2, 2021

I've been trying to put more more than one GRepatcha in the same page. For this, I set separate ids for each <GRecaptcha ... /> and these id assignments work just fine. But the reference to this.element is lost in this anonymous callback function and always resolves to the element of the last <GRecaptcha />. SInce the grecaptcha.render is called on the same this.element multiple times, it leads to the error.

@sinankeskin
Copy link
Member

Hey @musaffa multiple captcha in same page seems unnatural to me. All purpose to validate whether user is a real human being or robot. So, If you need 2nd or more captcha you must destroy the visible one and show the others but one at a time. That's the better approach I believe.

Closing for now. Feel free to reopen if you need.

Thanks for the comment.

@musaffa
Copy link
Author

musaffa commented Mar 1, 2022

Consider this use case. This is the admin login page. Login form has a recaptcha. At the footer, we have email subscription section. It's a common practice to place email subscription at the footer. This footer is available in all the pages. Email subscription section of the footer also has a recaptcha. Thus we have two recaptchas in the same page. This login and footer components live on their own. They don't to know whether the other component is using a recaptcha.

Screenshot from 2022-03-01 17-48-11

Btw, multiple recaptchas in the same page is allowed by Recaptcha.

@sinankeskin
Copy link
Member

Ok @musaffa got your point. I'll think about something. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants