The Submission Pre-Parser module provides a simple UI to add your own PHP to change the incoming POST data before it gets added to the database. The module is actually just an easy way to attach your own code to the Form Tools hooks for the submission insert and update functions/methods:
There's no reason why you can't utilize these hooks in your own modules, but we found that modifying the data prior to submission is such a useful feature, it warranted its own module.
Modifying and accessing the form data prior to submission has a number of uses, for example:
- If you need to group multiple form fields into one for simpler presentation in the Form Tools UI (e.g. if your form has a telephone number field split into 3 smaller fields).
- The opposite: you need to split a single form field into multiple fields.
- You want to ignore submissions that contain certain values in certain fields (e.g. this can be really handy for spam detection)
- You want to execute custom code submissions with particular field values (e.g. adding to another database)
The following sections explain the basic usage of the module and include some simple examples.