reCaptcha v2 not working for me

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
rvwilliams
Forum Members
Forum Members
Posts: 61
Joined: Wed Oct 05, 2011 9:59 am

reCaptcha v2 not working for me

Post by rvwilliams »

I'm trying to include reCatcha v2 to my CGBetterForms form. The code appears but I am able to click Submit without ticking the reCaptcha box for 'Im not a robot'.
CMSMS is version 2.2.14
Captcha version 1.0
CGBetterForms 1.10.4

I have configured Captcha to use ReCaptcha and added the Site Key and Secret values.

My form includes
<div class="g-recaptcha" data-sitekey="... site key ..."></div>

<div class="form-group">
<button type="reset">Reset</button>
<button type="submit">Submit</button>
</div>

The form validations include Validate Captcha

The page with the form has Page Specific Data
<__script__ src="https://www.google.com/recaptcha/api.js" async defer></__script>

What have I missed out?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: reCaptcha v2 not working for me

Post by DIGI3 »

In CGBF, under validators, click "auto add validations" or something similar. It doesn't work if you manually add just the captcha one, it's a bug in the module and the author abandoned it before it was fixed. There is a fork of it out now, I'm not sure if that bug has been fixed in it or not yet: http://dev.cmsmadesimple.org/projects/smartforms
Not getting the answer you need? CMSMS support options
rvwilliams
Forum Members
Forum Members
Posts: 61
Joined: Wed Oct 05, 2011 9:59 am

Re: reCaptcha v2 not working for me

Post by rvwilliams »

I have the Captcha validation set but I can still submit a form without checking the reCaptcha tick box.

When I look at the form under CGBetterForms, there is a message saying:

NOTICE: No captcha container was detected in the form markup.

Is this why it doesn't check to see if the reCaptcha validates?

What else may be wrong?
rvwilliams
Forum Members
Forum Members
Posts: 61
Joined: Wed Oct 05, 2011 9:59 am

Re: reCaptcha v2 not working for me

Post by rvwilliams »

Finally I have a working form. I had to make two changes:
Firstly my template was wrong. Instead of
<div class='g-recaptcha" data-sitekey='...my site key...'>
I should have had
<div data-cgbf-captcha data-sitekey='...my site key...'>
However even after this change the form would still submit without a recaptcha check. So the second change was to use SmartForms (thank you DIGI3) and change the tags to data-smtfm-xxx. This now works.
andrewvideouk
Forum Members
Forum Members
Posts: 155
Joined: Thu Aug 20, 2020 10:49 pm

Re: reCaptcha v2 not working for me

Post by andrewvideouk »

Yes the bug is still there in smartforms, I had to do the auto add. didnt work when I did manually add just the captcha one.
Post Reply

Return to “Modules/Add-Ons”