Multiple recaptcha puzzle on the same document but inside different form

971 views
Skip to first unread message

pavi

unread,
Jul 25, 2008, 11:58:08 AM7/25/08
to reCAPTCHA, pavit...@gmail.com
Hi There,

I have 2 forms in a html document... and each form is placed inside
its their div's respectively.

My question is when i try to call echo recaptcha_get_html($publickey,
$error); in both the form's it works only for the first one,

when i say it works only for the first one, i mean that the recaptcha
puzzle is displayed only for one form..


Please tell me if it is possible to have 2 recaptcha puzzle in the
same html document.


Thanks,

Paul Herring

unread,
Jul 25, 2008, 4:01:54 PM7/25/08
to reca...@googlegroups.com
On Fri, Jul 25, 2008 at 4:58 PM, pavi <pavit...@gmail.com> wrote:

> Please tell me if it is possible to have 2 recaptcha puzzle in the
> same html document.

Captcha is designed for when a user does something. (submit a form,
join up, post a message, etc.)

You appear to have 'lots' of these on a page.

There is rarely a circumstance where you'd need more than one captcha
(of any kind) to appear on a page. It should appear when your user
should do more than click on a link that doesn't take them elsewhere
than a page easily accesable from other urls.

If you have a captcha on your main page, or a frequently travelled
page where most would not use it, you are abusing not only this
service, but captcha in general.

--
PJH

'Two Dead in Baghdad' not 'product-friendly' - Kent Ertugrul, chief
executive of Phorm.

http://shabbleland.myminicity.com

Jeremy Clarke

unread,
Jul 25, 2008, 4:10:41 PM7/25/08
to reca...@googlegroups.com
I think he's saying that he has two different <form> elements with two
seperate sets of fields and actions that just happen to be on the same
page. In each of these forms is a recaptcha because it needs to be
part of the form that gets submitted. For any given form submission
from that one page only one of the recaptcha's would be filled out
(the one in that form), which in theory sounds like it makes sense,
but which in practice he's finding that the second recaptcha doesn't
work.

Pavi, it probably isn't very feasible to show more than one recaptcha
on a page, and if you want to do so you're asking for trouble (i.e.
you'll have to code your way around the complications yourself)

Have you tried combining the two forms into one and controlling the
results based on the id and name of the submit button, or some other
input elements in the page that you could use to differentiate?
Otherwise, it might be worth considering seperating the two sets of
inputs into two pages.

--
Jeremy Clarke
Code and Design | globalvoicesonline.org

shabda raaj

unread,
Jul 26, 2008, 2:05:32 PM7/26/08
to reCAPTCHA
I am trying the same thing, and having this problem. What I am trying
is,

I get the html fragment as

<script type="text/javascript">
var RecaptchaOptions={theme:'red', lang:'en', tabindex:'0',
custom_theme_widget:'null'};
</script>
<script type="text/javascript" src="http://api.recaptcha.net/challenge?
k=6LeZlAIAAAAAAPHXMxfuqflxfIFUp_kQTn_bwLDe"></script>
<noscript>
<div>
<object data="http://api.recaptcha.net/noscript?
k=6LeZlAIAAAAAAPHXMxfuqflxfIFUp_kQTn_bwLDe" type="text/html"
height="300" width="500"></object>
</div>
<p><textarea name="recaptcha_challenge_field" rows="3" cols="40"></
textarea></p>
<p><input type='hidden' name='recaptcha_response_field'
value='manual_challenge' /></p>
</noscript>


From this parse out the text in the noscript and show that, instead of
using the Javascript. Any gotchas I should be looking for?

Also this can be a common requirement, Say I have a register form,
where I can have two types of users. There are two forms corresponding
to each type of user, and each needs a captcha.

On Jul 26, 1:10 am, "Jeremy Clarke" <j...@simianuprising.com> wrote:
> I think he's saying that he has two different <form> elements with two
> seperate sets of fields and actions that just happen to be on the same
> page. In each of these forms is a recaptcha because it needs to be
> part of the form that gets submitted. For any given form submission
> from that one page only one of the recaptcha's would be filled out
> (the one in that form), which in theory sounds like it makes sense,
> but which in practice he's finding that the second recaptcha doesn't
> work.
>
> Pavi, it probably isn't very feasible to show more than one recaptcha
> on a page, and if you want to do so you're asking for trouble (i.e.
> you'll have to code your way around the complications yourself)
>
> Have you tried combining the two forms into one and controlling the
> results based on the id and name of the submit button, or some other
> input elements in the page that you could use to differentiate?
> Otherwise, it might be worth considering seperating the two sets of
> inputs into two pages.
>
> --
> Jeremy Clarke
> Code and Design | globalvoicesonline.org
>
> On Fri, Jul 25, 2008 at 4:01 PM, Paul Herring <pauljherr...@gmail.com> wrote:

Jeremy Clarke

unread,
Jul 26, 2008, 3:09:01 PM7/26/08
to reca...@googlegroups.com
On Sat, Jul 26, 2008 at 2:05 PM, shabda raaj <shabd...@gmail.com> wrote:
>
> Also this can be a common requirement, Say I have a register form,
> where I can have two types of users. There are two forms corresponding
> to each type of user, and each needs a captcha.
>

i think if you tackle your problem creatively you'll see that there
are ways around it, especially when the benefits of just one recaptcha
are so big (if only because they take up a lot of space, let alone the
coding horror).

In your example I would say that you should make one <form> with an
input option for which type of user account to create, then just use
that option when you process the form to define user type.

Alternately, if you have a ton of different inputs for the two types,
why not get your script to show the form for just one of the user
types on each pageload (default to the most common), and use a _GET
variable in a link to change the type of user being requested (showing
only the relevant inputs)? It would look clean and you'd still have
only one script.

I'm not saying that you shouldn't try to figure out a way to have two
recaptcha's on one page if it really makes your life simpler, but that
it isn't really a 'requirement' since there are always ways to work
around the problem without really compromising any functionality.

Ngoc Dao

unread,
Jul 26, 2008, 8:22:38 PM7/26/08
to reca...@googlegroups.com
You can use the idea from ondemandcaptcha:
http://rubyforge.org/projects/ondemandcaptcha/

Ngoc.

Reply all
Reply to author
Forward
0 new messages