formsrecaptchagravrecaptcha-v3

Grav CMS form Integraion with Recaptcha v3


I am using Grav form v2.16.4 - i want to integrate recaptcha v3 to it but it doesn't work.

I have added the below field to it as in the documentation, please let me know if there is any issue in it?

 recaptcha:
 name: g-recaptcha-response
 version: 2-checkbox
 site_key: 6LczAsUUAAAefefwefwefe
 secret_key: sfefefwefwfcaEB0fsadzKggE
 type: hidden

Here is the documentation i followed -(https://learn.getgrav.org/16/forms/forms/fields-available#captcha-field), And also i have added the recaptcha script in the head , which shows the recaptch symbol on the site now.

please help on this. i m not familiar with Grav cms.

Thank you!


Solution

  • Hi Here is the solution - so what i did was - i updated the Grav form to version 4, then there you could find the recaptch latest version 3 in the drop down. And after that just need to put this code to the form -

     -        
               name: g-recaptcha-response
               label: Captcha
               type: captcha
               recaptcha_site_key: ////////
               recaptcha_not_validated: 'Captcha not valid!'
               validate:
                    required: true

    And In process

    process:
            -
               captcha:
                    recaptcha_secret: ///////
            -
                save:
                    fileprefix: feedback-
                    dateformat: Ymd-His-u
                    extension: txt

    This worked for me, please let me know if anyone need help on this.