I have an item in a form that is ajax enabled and the ajax callback returns the whole form. When for form is re-drawn on the page, the HTML wrapper for ReCaptcha is there but the JavaScript call to place the elements in the wrapper are not. If I refresh the page, the element reappears. I'm not sure how image_captcha_refresh does this differently, but that one works fine in the place of ReCaptcha.

Comments

liam morland’s picture

Status: Active » Postponed (maintainer needs more info)

Are you using the Ajax API setting in the reCAPTCHA configuration?

This might be a duplicate of one of these:
#1349850: drupal_get_form() doesn't render recaptcha
#1119086: reCaptcha form not display in Colorbox iframe

epiphanydigital’s picture

I get the same results whether the Ajax box is checked or not. I have not tried the development version of the module.

This is probably the same issue as drupal_get_form() as along with drupal_render($form) since the HTML will continue to be generated but the JavaScript isn't called a second time to repopulate the wrapper.

liam morland’s picture

You could try the development version. It may be that you need to manually trigger the JS.

liam morland’s picture

Version: 7.x-1.8 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Closed (works as designed)

Try the development version. If you are still having problems, please reopen and provide details.

mortona2k’s picture

Status: Closed (works as designed) » Active

I'm having the same problem with both 7.x-1.x-dev (2/12/13) and 7.x-1.9, both with and without using reCaptcha's ajax api.

My ajax is a hierarchical select on a profile2 form, using profile2_regpath. The select list only returns a second select list is returned, instead of the whole form like epiphanydigital does.

With the ajax api setting on, the captcha disappears, and with it off, it throws the reuse attack error.

With it on, here is the error in my console:
Uncaught TypeError: Cannot call method 'call' of undefined

liam morland’s picture

liam morland’s picture

Status: Active » Postponed (maintainer needs more info)
liam morland’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Try the latest development version of both reCAPTCHA and CAPTCHA, and the patch in #918856: CAPTCHA Session Reuse message on webforms . If you are still having problems, please reopen and provide details.