Hi, your contact form templates work perfectly with Google recpatcha v2 "I'm not a robot" tickbox. But is it possible to use it with the invisible Google recpatcha v2 as per https://developers.google.com/recaptcha/docs/invisible ? I can't seem to get it to work! Any ideas? Thanks
Contact form with recaptcha v2 invisible
4 replies · opened Feb 19, 2021
Hello,
Google reCaptcha v2 invisible is not implemented out of the box but should work fine by simply adding data-size="invisible" Attribute to the existing Google reCaptcha codes. We recommend using Google reCaptcha v3 instead as this has been already included and implemented with Canvas. Simply use the contact-recaptcha-v3.html Template from the Package/HTML Folder.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Thanks. I tried adding data-size="invisible" before I contacted you because I too thought that would work. It correctly makes the recpatcha invisible (adding the small banner at the side of the page instead) but the form just comes back with "captcha not validated" every time I submit. I assume form.php or whatever is validating the callback from google isn't working with the invisible recaptcha? I didn't want to use recaptcha v3 due to privacy issues so was hoping to use V2 invisible instead. Any thoughts?
Also, I have made a couple of changes which I wanted to check are OK:
- I wanted the form messages/alerts to be center center instead of top right. The only way I could find to do this is by adding this to my custom.css:
#toast-container {
left: 50%;
top: 50%;
position: fixed;
transform: translate(-50%, -50%);
z-index: 9999;
}
.toast-top-right {
left: auto;
top: auto;
right: auto;
bottom: auto;
}
Does that seem OK or is there a better way?
- The textarea message from the contact form doesn't preserve line breaks. To fix this I added this to form.php in the "foreach( $fields as $fieldname => $fieldvalue ) {" section:
$fieldvalue = nl2br($fieldvalue);
It works perfectly but do you see any issues with this?
Many Thanks
Helen
Hello,
We have tried working on the reCaptcha v2 Invisible but it appears that the Current AJAX Functionality of the Form is interfering with the reCaptcha functionality when it is set to invisible. So currently we do not have a Solution available for this but we will definitely work on this and notify you once it is available. Thanks for your Patience.
This code appears to be fine. We will be introducing this Position Option in the Next Update. So the classes will be based on the position. You can continue using this for now and you can update once the Update is released.
Perfect! We didn't even factor our codes for the Line breaks but thanks to you! We will include this in the Next Update.
Let us know if we can help you with anything else or if you find any further issues.
Great, thanks a lot!
Have the same question, or something new?
Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.
Reply on the dashboard