FormItSaveForm
Last updated May 1st, 2025 | 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
$289 per month—let's make that $500!
Learn moreThe FormItSaveForm hook¶
This hook will save submitted forms inside an CMP.
FormIt 3.0 introduces an update to the encryption methods used for encrypting form submissions. Prior to 3.0 mcrypt was used, which in 3.0 is replaced with openssl, due to mcrypt being deprecated as of PHP 7.2. FormIt 3.0 comes with a migration page which is accessible from the manager.
Available Properties¶
It has the following properties to be passed into the FormIt snippet call:
Name | Description | Example |
---|---|---|
formName | The name of the form. Defaults to "form-{resourceid}". | |
formEncrypt | If is set to '1' (true) the submitted form will be encrypted before saving inside the DB. | |
formFields | A comma-separated list of fields that will be saved. Defaults will save all fields including the submit button. | |
fieldNames | Change the name of the field inside the CMP. So if the field name is email2 you could change the name to "secondary email". | &fieldnames=`fieldname==Field display name,anotherone==Another field display name` |
Cleaning up of old forms¶
Depending on local laws, storing form submissions for eternity might be a privacy concern.
To address this issue, formit offers a quick and easy way to remove form submissions after a set number of days by setting up a cronjob.
As a default, the cronjob will remove all form submissions older than 30 days whenever it is triggered.
This value can be changed by setting a different number of days in system settings: formit.cleanform.days.
Cronjob Setup¶
Please use the following path: /(full_path_to)/assets/components/formit/cronjob/cron.php
Hint: You can see the full path during installation:
Note: cron.php only accepts request via CLI. You can do this by adding a new cronjob via SSH or by using cronmanager to trigger the cleanup routine.
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
$289 per month—let's make that $500!
Learn more