Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Recaptcha in modular form

Started by Muut Archive 10 years ago · 1 replies · 710 views
10 years ago

Hi
I have a modular form which works perfectly well apart from the captcha.
In my form I have the field:

YAML
-
  name: g-recaptcha-response
  label: Captcha
  type: captcha
  recaptcha_site_key: '{{ config.plugins.form.recaptcha.site_key }}'
  recaptcha_not_validated: 'Captcha not valid!'
  validate:
    required: true

And in the process I have:

TWIG
- captcha:
    recatpcha_secret: '{{ config.plugins.form.recaptcha.secret_key }}'

I have set the page to process Twig and the form and captcha display correctly. The problem that I have is that when I submit the form and fill in the captcha it does not validate. I still get a message stating "Error validating the Captcha".

If i replace the {{ config.plugins.form.recaptcha.secret_key }} with my actual key then the captcha works but it would be great to be able to access the key that I have already added to the form plugin config. Is this possible?

10 years ago

If you don't populate these recapatcha values in your form, it should pull the values automatically from your plugin configuration.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1656 9 years ago
Archive · by Muut Archive, 9 years ago
2 1120 9 years ago
Archive · by Muut Archive, 9 years ago
2 4281 9 years ago
Archive · by Muut Archive, 9 years ago
1 3157 9 years ago
Archive · by Muut Archive, 9 years ago
3 1285 9 years ago