recaptcha
Last updated Apr 29th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$306 per month—let's make that $500!
Learn moreThe recaptcha hook¶
The recaptcha hook will enable reCaptcha support for FormIt forms.
Usage¶
First off, add "recaptcha" to your &hooks parameter in your FormIt call. Then you'll need to include the following placeholders in your form:
[[+formit.recaptcha_html]]
[[!+fi.error.recaptcha]]
The first placeholder is where the reCaptcha form will be rendered; the 2nd is the error message (if any) for reCaptcha.
Finally, you'll need to setup your reCaptcha private and public keys in System Settings. The settings available for reCaptcha are:
Name | Description |
---|---|
formit.recaptcha_public_key | Your reCaptcha public key. |
formit.recaptcha_private_key | Your reCaptcha private key. |
formit.recaptcha_use_ssl | Whether or not to use SSL for reCaptcha requests. Defaults to false. |
Available Properties¶
The reCaptcha hook has a few extra configuration options:
Name | Description | Default |
---|---|---|
recaptchaJs | A JSON object to pass into the RecaptchaOptions var, which configures the reCaptcha widget. See the official reCaptcha docs for more information. | {} |
recaptchaTheme | The recaptcha theme to use. | clean |
See Also¶
- FormIt.Hooks.email
- FormIt.Hooks.FormItAutoResponder
- FormIt.Hooks.FormItSaveForm
- FormIt.Hooks.math
- FormIt.Hooks.recaptcha
- FormIt.Hooks.redirect
- FormIt.Hooks.spam
- FormIt.PreHooks.FormItLoadSavedForm
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$306 per month—let's make that $500!
Learn more