Hi,
i'm trying to install a Recaptcha (or Invisible Recaptcha) on a CG BetterForm, but with Captcha module active or not (code pasted in the templates directly) i can't achieve it.
It seems that the submit function doesn't take care at the Captcha state.
If anybody has an example of working integration... !!
Thanks for help !
How to install Recaptcha on CGBetterForm
Re: How to install Recaptcha on CGBetterForm
I'd be happy to help you out with this directly if you get stuck, but I think you just need to add the default validators. (Validation tab, click on "auto add validations" then save your form.
Not getting the answer you need? CMSMS support options
Re: How to install Recaptcha on CGBetterForm
Hi, thanks for replying !
I got these validators yet :
Detect HTML tags in form input
Validate the value of select fields
Validate that all required fields are present
Ensure a reasonable value for all email fields
But i can still send the form without checking the box " i'm not a robot " from recaptcha.
My Form template:
The div containing the captcha :
In the head:
Is something missing?
I got these validators yet :
Detect HTML tags in form input
Validate the value of select fields
Validate that all required fields are present
Ensure a reasonable value for all email fields
But i can still send the form without checking the box " i'm not a robot " from recaptcha.
My Form template:
Code: Select all
<form>
<div>
<label for="myname">Name</label>
<input id="myname" class="form-control" name="name" value="{$form_data->name}" required/>
</div>
<div>
<label for="myemail">Email</label>
<input id="myemail" class="form-control" type="email" name="email" value="{$form_data->email}" required/>
</div>
<div>
<label for="comments">Comments</label>
<textarea id="comments" class="form-control" name="comments" required>{$form_data->contents}</textarea>
</div>
<div class="g-recaptcha" data-sitekey="mykey"></div>
<div>
<button type="submit" class="fdorange">Send</button>
</div>
</form>
The div containing the captcha :
Code: Select all
<div class="g-recaptcha" data-sitekey="mykey"><div style="width: 304px; height: 78px;"><div><__iframe src="https://www.google.com/recaptcha/api2/anchor?ar=1&k=...></__iframe></div><textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;"></textarea></div></div>
Code: Select all
<__script__ src="https://www.google.com/recaptcha/api.js" async="" defer=""></__script>
Re: How to install Recaptcha on CGBetterForm
Oh I didn't notice you weren't using the Captcha module. No idea then.
Not getting the answer you need? CMSMS support options
Re: How to install Recaptcha on CGBetterForm
I retried with the Captcha Module on, and same result ! I can send the form without checking the box :s
Re: How to install Recaptcha on CGBetterForm
With the Captcha module installed there's a few steps you have to do:
-configure the Captcha module
-edit your CGBF form template to include the captcha tag and error display items (see the cgbf docs and/or the sample form templates)
-re-add the the auto validations. If the captcha tag (not captcha code, but the cgbf-specific captcha tag) is detected in your form template, the captcha validation will be added.
-configure the Captcha module
-edit your CGBF form template to include the captcha tag and error display items (see the cgbf docs and/or the sample form templates)
-re-add the the auto validations. If the captcha tag (not captcha code, but the cgbf-specific captcha tag) is detected in your form template, the captcha validation will be added.
Not getting the answer you need? CMSMS support options
Re: How to install Recaptcha on CGBetterForm
Oh, it works now with your steps to do! Many many thanks !!