Google Recaptcha v3 not work in modular page

Hi

I have the contact form in a modular page, and when I configure the .md file with the Grav website instructions, it show “Captcha not valid”.
I have configured the site and secret keys in the form plugin.

My code is this:

name: g-recaptcha-response
label: Captcha
type: captcha
recaptcha_not_validated: 'Captcha not valid!'

process:
    captcha: true

What’s wrong?

I also couldn’t make v3 work in modules. Still using v2

Hi.

I’ve changed to V2 invisible, and the form.yaml is this:

recaptcha:
  version: 2-invisible
  theme: light
  site_key: XXXXXXXXXXXX
  secret_key: XXXXXXXXXXXX

In contact.md …

-
      name: g-recaptcha-response
      label: Captcha
      type: captcha
      recaptcha_not_validated: 'Captcha not valid!'
process:
        captcha: true

However, is still failing with message “Captcha not valid”.

My contact.html.twig modular page has this code:

{% block content %}

<!-- Contact -->
<section id="contact" class="wrapper style2">
    <div class="inner narrow">
        <header class="heading major">
            <h2>{{page.title|raw}}</h2>
            <p>{{page.header.subtitle|raw}}</p>
        </header>
        <form action="#" method="post">
            {% include 'forms/form.html.twig' with { form: forms('contact-form') } %}
        </form>
    </div>
</section>


{% endblock %}

Is there any wrong?

Sorry, didn’t mention - I couldn’t make v2 invisible work either :sweat_smile: Users still have to check they’re not robots on my page :smiley:

Finally I have chosen to use version 2 of Google’s captcha, with checkbox, and it is working correctly.
It seems that versions 3 and 2 - invisible, don’t work well with the form plugin.

Thanks for your help

Actually, there are more problems with reCapatcha.
I’ve created a bug report but haven’t received any answer from developers.
You could upvote it, maybe they will take a look at it.

1 Like