silverstripe-recaptcha icon indicating copy to clipboard operation
silverstripe-recaptcha copied to clipboard

Having multiple instances on a page using spamprotection and comments

Open DiscoPixel opened this issue 9 years ago • 2 comments

Hi there, I'm trying to create a blog with silverstripe-spamprotection and silverstripe-comments. The comments have 2 levels: comments and replies to comments. Since I want to protect the comments and their replies with recaptcha+spamprotection I'm using the CommentSpamProtection of silverstripe-spamprotection. But only the first captcha is rendered. I think it's due to the fact that multiple same HTML IDs are given to the containers and Google only renderes the captcha in the first container available. Is there a way to get that working? Or can you confirm that multiple Recaptchas on one page are not supported by silverstripe-recaptcha + silverstripe-spamprotection + silverstripe-comments? Thanks for your reply

DiscoPixel avatar Apr 10 '16 19:04 DiscoPixel

I think multiple ReCaptcha on a single page won't work, unless they have the same fieldname. @chillu You have anything about this? I could check up with that as well while working on the SS4 version?

Firesphere avatar Oct 31 '16 07:10 Firesphere

Its definitely possible, but not with <div class="g-recaptcha"> (see https://github.com/chillu/silverstripe-recaptcha/blob/master/templates/recaptcha.ss). We'd have to explicitly render the widget, see https://developers.google.com/recaptcha/docs/display

chillu avatar Dec 08 '16 09:12 chillu