A
A
Anton Misyagin2015-05-14 00:13:39
reCAPTCHA
Anton Misyagin, 2015-05-14 00:13:39

How to insert multiple reCAPTCHAs on one page?

I'm using RoR 4.2.0 in the project
gem 'recaptcha'
https://github.com/google/ReCAPTCHA
This captcha works great. But there is one place in the program where it does not work out as I would like. There is a comment form and a complaint form on the blog post page. I wanted to insert a captcha into each form. But it turns out that the captcha is present once per page. A similar question has already been asked: How to install multiple forms with reCAPTCHA on one page? There was no answer. I think it's redundant to provide code. There are two partials, each of which calls: Has
<%= recaptcha_tags %>
anyone had similar questions? Who got around the situation? Thank you.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexey Ukolov, 2015-05-14
@sunnmas

There can only be one reCaptcha per page at a time.
stackoverflow.com/questions/1034427/multiple-recap...
https://groups.google.com/forum/#!topic/recaptcha/...

L
LegionLeonhart, 2015-10-08
@LegionLeonhart

here is how to create multiple reCaptchas on one page

C
CaHeK_pk, 2019-06-10
@CaHeK_pk

I decided a little differently: after entering the inputs and clicking "submit", a captcha confirmation window appears, which in turn jumps from form to form through the script. as a result, we have one captcha for all forms, and a nice, not overloaded interface, especially for mobile versions of sites

A
Anton Misyagin, 2015-05-14
@sunnmas

Correspondence with the author of the gem:
me

Hi! I use your gem in my RoR app.
Recaptcha works well. But when I try to add more than one Recaptcha on different forms at single page - I see only one of them.
I try get 2 Recaptha for my syte at Google:
at first form:
recaptcha_tags :public_key => Rails.application.secrets.recapcha_public_key
at second form:
recaptcha_tags :public_key => Rails.application.secrets.recapcha_public_key2
It doesn't help me.
How can I fix it? thanks

is he:
Are you able to put two recaptcha on the page even without the gem, just manually? I'm not sure it's a problem with the gem.

Jason L Perry

I:
There was no answer. But I realized that there is no solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question