We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Hi,

    I have recaptcha working with a registration form - all fine - but ugly as hell.
    So I installed the recaptchaV2 Extra.
    This is what I had for recaptchaV1:
    [[!Register?
        &submitVar=`registerbtn`
        &activationResourceId=`114`
        &activationEmailTpl=`lgnActivateEmailTpl`
        &activationEmailSubject=`Thanks for Registering with the LTDA!`
        &submittedResourceId=`113`
        &validate=`nospam:blank`
        &usergroups=`Members`
        &preHooks=`recaptcha`
    ]]
    

    In the form I have this:
        
     [[!+recaptcha_html]]
    [[!+error.recaptcha]]
    

    All working fine.

    I have now installed recaptchav2 and have swapped the snippet to:
     
    [[!Register?
        &submitVar=`registerbtn`
        &activationResourceId=`114`
        &activationEmailTpl=`lgnActivateEmailTpl`
        &activationEmailSubject=`Thanks for Registering with the LTDA!`
        &submittedResourceId=`113`
        &validate=`nospam:blank`
        &usergroups=`Members`
        &preHooks=`recaptchav2`
    ]]
    


    And am calling this in my form:
     
    [[!recaptchav2_render]]
    [[!+fi.error.recaptchav2_error]]
    


    But it shows nothing. The site and secret keys etc are all there, as V1 was working.
    Any ideas?

    Thanks
    Andy
      • 51020
      • 670 Posts

      On the extra the developer states the following so not sure it will work like that

      I tried making the render snippet usable as a preHook for FormIt but ran out of time.


      Have you tried using &hooks=`recaptchav2`



      That's for formit - but the docs said it can be used in the Login Snippet with prehooks.
      I tried &hooks=`recaptchav2` but it didn't work either.
        • 51020
        • 670 Posts
        I got this working - I didn't realise that recaptchaV2 had it's own system settings!!
        I thought the original Site key and secret key would work - then I checked and it's a separate setting altogether!!

        Doh! - every day is a school day!

          • 43851
          • 21 Posts
          Having the same problem on a site running Modx 2.2.5 (just can't upgrade it at the moment using the UpgradeMODX extra). It's running on php 5.4. I've upgraded Formit to latest version, installed RecaptchaV2 and inserted the site keys in the recaptchav2 settings, but it is failing to render. This is my Formit call:
          [[!FormIt?
          &spamEmailFields=`email,subject`
          &hooks=`recaptchav2,spam,email`
          &emailTpl=`ContactResponse`
          &emailTo=`[email protected]`
          &validate=`message:stripTags`
          &successMessage=`<div class="alert alert-success">
          <h3>Your message has been submitted successfully.</h3>
          </div>`
          ]]
          [[!+fi.successMessage]]

          And the recaptchav2 render:

          [[!recaptchav2_render]]
          [[!+fi.error.recaptchav2_error]]

          It was working perfectly when using version 1 of recaptcha