Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Chris Van Oort 110 posts 370 karma points
    Mar 10, 2017 @ 15:51
    Chris Van Oort

    Upgrade Umbraco Forms reCAPTCHA v2 to Invisible reCAPTCHA?

    Has anyone embarked on upgrading Umbraco Forms reCAPTCHA v2 to the Invisible reCAPTCHA?

    I've previously used Heather Floyd's code here and it works great: I'm betting with some tweaks the new invisible version would drop in fairly easily as a replacement.

    Info on the new version:

    It looks like it's fairly similar to the previous version, however, it has an added caveat for a callback function?

    enter image description here

  • ALL41 1 post 71 karma points
    Mar 12, 2017 @ 20:04

    Hi Chris! I got excited at first about it too, but then after a quick search on google (oh the irony) I found this: Those guys at 2captcha have already found a way to beat it) So from what I understand after reading their description new ReCaptcha isn't that invisible - I wouldn't consider it (on it's own) a sufficient protection against spammers.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Mar 13, 2017 @ 19:29
    Alex Skrypnyk

    Hi Chris

    I wanted to make Change from Umbraco reCAPTCHA 2 to invisible, but I didn't do it because it's beta now, am I right? It's not released yet.

    I think we will do it like package, as we made it for reCAPTCHA 2 -



  • Luke Robinson 10 posts 91 karma points
    Feb 19, 2018 @ 14:36
    Luke Robinson

    Hi Alex,

    I'm just wondering if you ever decided to work on a package for an invisible reCAPTCHA for Umbraco forms?



  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Feb 19, 2018 @ 15:06
    Alex Skrypnyk

    Hi Luke

    Yes, it's exactly what I want to create next, I thought about it Did you try it already?


  • Luke Robinson 10 posts 91 karma points
    Feb 19, 2018 @ 15:24
    Luke Robinson

    Thanks for the quick reply Alex. I haven't tried it yet, I'm just looking for a solution because I'm having a bit of trouble integrating the invisible reCAPTCHA with Umbraco forms.

  • Namrata 8 posts 78 karma points
    15 days ago

    Hello Luke and Alex,

    Did you guys ended up integrating the invisible reCaptcha with Umbraco forms ? I am trying to do the same however, having trouble while generating the recaptcha token on form submission as it creates bit of disturbance while continuing the default workflow.

    Thanks, Namrata

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    15 days ago
    Alex Skrypnyk


    What umbraco version and what Umbraco forms version are you using?


  • Namrata 8 posts 78 karma points
    1 week ago

    Hello Alex,

    Thanks for the response.

    I am using Umbraco 12.0.1 and Umbraco Forms (12.0.0). I am trying to integrate the invisible enterprise reCaptcha v2.

    Here is the custom field type code :

    @using Umbraco.Forms.Web
    @using Microsoft.Extensions.Configuration
    @model Umbraco.Forms.Web.Models.FieldViewModel
    @inject IConfiguration Configuration
        var siteKey = Configuration.GetSection("ReCaptchaEnterprise")["PublicKey"];
            if (!string.IsNullOrEmpty(siteKey))
            {   Html.AddFormThemeScriptFile("" + siteKey);
                Html.AddFormThemeScriptFile(""+ siteKey);
                <div class="g-recaptcha"
    <script type="application/javascript">
                let formElement; 
                function onSubmit(){
                    console.log("Form Element", formElement);
                document.addEventListener('DOMContentLoaded', function(){
                        document.querySelectorAll(".umbraco-forms-form form")
                            .forEach((form) =>  { 
                                form.addEventListener("submit", (event) => {
                                    formElement =;
                                }, true)
            <p class="error">ERROR: reCAPTCHA is missing the Site Key. Please update the configuration to include a value.</p>

    However, there are two strange behaviour :

    • For every request reCaptcha prompts the image dialog which negates the entire idea of having an invisible reCaptcha.
    • After form submit event when the form submission is intercepted by the script it doesn't submits the form and just lands on the same page not following the default workflow.

    I am not sure what I am doing is even possible in Umbraco environment or am I missing out on anything.

    Thanks, Namrata.

Please Sign in or register to post replies

Write your reply to: