Jump to main content Jump to doc navigation

recaptcha

Other versions: 3.x — Found a problem? Please edit this page or report an issue.

The 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

  1. FormIt.Hooks.email
  2. FormIt.Hooks.FormItAutoResponder
  3. FormIt.Hooks.FormItSaveForm
  4. FormIt.Hooks.math
  5. FormIt.Hooks.recaptcha
  6. FormIt.Hooks.redirect
  7. FormIt.Hooks.spam
  8. FormIt.PreHooks.FormItLoadSavedForm