DOCUMENTATION

  • Developer
Search »

Submission Pre-Parser

Add vs. Update POST values

This page is only important if you want to add pre-parser rules that will be executed both when the submission is first made AND when it's updated via the Form Tools UI.

The POST information for adding and updating submissions differs in two ways:

  1. The $_POST variable from a form will contain the form field names as the keys. For submission update requests from the Form Tools UI, the requests will have the database column name as the key.
  2. Update requests may only contain a subset of the fields. This can happen if you group the form submission data into separate tabs.

Workaround #1

Create two separate rules: one to get executed for ADD requests, another for UPDATE. You can do this with a simple boolean test:

Workaround #2

Another solution is to update the database column names to match your form field names. This isn't a bad idea. For programmers planning on working with the code, it's well worth updating the database column names to make them more descriptive.

To do this, go to your Edit Form ยป Database tab and click "Smart Fill". This will set the database column names to the same as your form field names.

Beware! This isn't 100% guaranteed to make the database column names and your form fields identical! The Smart Fill script compares your form field names against a list of MySQL reserved words, and if there are any matches, generates a DIFFERENT column name. Check them over manually.