Jump to main content Jump to doc navigation

hook.RampartFormIt

To enable Rampart spam prevention on your FormIt forms, simply add hook.RampartFormIt as a hook in your FormIt call:

[[!FormIt?
    &hook=`hook.RampartFormIt`
    &rptErrorField=`rampart`
    &submitVar=`contact_me`
]]

/* somewhere in my form */
[[!+fi.error.rampart]]

Available Properties

It has the following properties to be passed into the FormIt snippet call:

name description default
rptErrorField The name of the field that Rampart should set an error message for should it flag a spam attempt. email
rptUsernameField If you have a field not named "username", but want to use it to spam-check as a username on, set the name of the field here. If Rampart doesn't find the field, it will ignore it. username
rptEmailField If you have a field not named "email", but want to use it to spam-check as an email on, set the name of the field here. If Rampart doesn't find the field, it will ignore it. email
rptSpammerErrorMessage The field-specific message that will show when a spammer tries to submit the form. Your account has been banned as a spammer. Sorry.

See Also

  1. Rampart.hook.RampartFormIt
  2. Rampart.hook.RampartQuip
  3. Rampart.preHook.RampartRegister

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

  • modmore
  • STERC
  • Jens Wittmann – Gestaltung & Entwicklung
  • Fabian Christen
  • Digital Penguin
  • Dannevang Digital
  • Sepia River Studios
  • CrewMark
  • Chris Fickling
  • deJaya
  • Following Sea
  • Anton Tarasov
  • eydolan
  • Raffy
  • Lefthandmedia
  • Murray Wood
  • Snow Creative
  • Nick Clark
  • Helen
  • JT Skaggs
  • krisznet
  • YJ
  • Yanni
  • Richard

Budget

$366 per month—let's make that $500!

Learn more