Jump to main content Jump to doc navigation

The FormItLoadSavedForm preHook

This pre-hook will load the data for submitted forms by the provided hash, which is also available on the CMP of FormIt. It needs to be used together with the FormIt.Hooks.FormItSaveForm

Usage

To use the preHook, you need to use the following snippet call

[[!FormIt?
    &preHooks=`FormItLoadSavedForm`
    &updateSavedForm=`true`
    &savedFormHashKeyField=`yourCustomGetParameter`
    &hooks=`FormItSaveForm`
    &formFields=`name,address,zipCode,town` // parameter of FormItSaveForm
]]
// open the page in the browser
// http://your-domain.com/path/to/form?yourCustomGetParameter=<FormHashFromFormItCMP>

Please note: you must not use the parameter fieldNames because it makes assigning the form values to the fields impossible

Available Properties

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

name description
savedFormHashKeyField The get parameter to take the submission hash from the url. Defaults to "savedFormHashKey".
updateSavedForm If loading the previously submitted form values should be possible. Defaults to false.
returnValueOnFail If the preHook should return true on fail. Defaults to true

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

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
  • Jens Wittmann – Gestaltung & Entwicklung
  • Digital Penguin
  • eydolan
  • deJaya
  • Following Sea
  • Nick Clark
  • Lefthandmedia
  • YJ
  • Sepia River Studios
  • Murray Wood
  • Dannevang Digital
  • Richard

Budget

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

Learn more