Error Handling

A form handler pipeline can have two kinds of conditional processing. Nearly all forms will have some kind of processing based on input validation or spam catching. This kind of conditional processing is constructed using the On Error / On Success form handlers.

Form Reform's second kind of conditional processing is a more involved if/elseif/else Conditional Processing using the Condition IfCondition ElseIfCondition Else and Condition End form handlers. These can be used to control form processing by specifying conditions on form and CMS data.

On Error / On Success

The form handler pipeline accumulates a list of error reports returned from form handlers such as Spam Detect and Validate Input Fields.

Other form handlers may also contribute to this list of errors, either explicitly such as Set Error and Set Error Conditional or as a result of error reports returned by external interfaces such as Send Email or from a custom API handler.

To manage handling of these accumulated error reports, we have the On Error and On Success form handlers. These can be used at any point in the handler pipeline to conduct different processing depending on any errors that have been noted.

On Success First

You can see this in action in the Example Handler Processing. Here the fundamentals are: 

Spam Detect

Validate Input Fields

On Success

... process the form and report success.

On Error

... report errors and end.

On Error First

The processing can also be configured the other way round:

Spam Detect

Validate Input Fields

On Error

... report errors.

On Success

... process the form, report success and end.

Either way round works the same and is equivalent. On Success processing ends the pipeline when it gets to the On Error handler, or On Error processing ends the pipeline when it gets to the On Success handler.

Its up to you and your form application how you like to structure the error handling with error or success processing first.

Multiple Success or Error Handlers

Processing is not limited to a single pair of On Error and On Success handlers. You could have multiple On Error handlers followed by a single On Success handler, or more typically multiple On Success handlers preceding a single On Error handler. 

Spam Detect

Validate Input Fields

On Success

... Do something with the form data that could fail.

On Success

... Do something else with the form data that could fail.

On Success

... Do something more the form data that could fail.

On Success

... any final processing of the form and report success.

On Error

... report errors and end.

In this scheme, every time we do something that could fail, we follow it with an On Success that gates whether processing can continue. Then a single On Error handler at the end can report any errors that happen.

Set Error Conditional

For more complex form validation, the Set Error Conditional handler can be used to set an error based on a chain of compound conditions. In its simplest form, this could be to compare two inputs, such as an end date being greater than a start date.

The error set can then be tested with the usual On Success .. On Error handling as described above.

Condition If, Condition ElseIf, Condition Else and Condition End

Condition IfCondition ElseIfCondition Else and Condition End form handlers are Form Reform's second kind of conditional processing. These can be used to implement  a more involved if/elseif/else logic by specifying conditions on form and CMS data.

Some basic rules:

  1. Conditional processing cannot be nested. The shouldn't put a Condition If inside a Condition If, and if you do the processing is undefined and unsupported.
  2. For error handling use On Error / On Success. Don't try and handle errors with Condition If.

Set Error Conditional

A convenient way to evaluate a condition and set an error is to use the Set Error Conditional handler. This is effectively the equivalent of the handler pipeline sequence Condition If ... Set Error ... Condition End

Additional Pages

Reform the way you add new input controls

If you need a specialized template or a custom input element, you can design new templates  or new block types for form elements as you would any block type.

Blocks are easy for third party addition or extension. Block templates and are the first thing any Concrete CMS developer learns to code. They are one of the easiest things to code. The underlying mechanisms are well established and reliable.

Reform what you can do with form data

Form handlers are built about the same extensible plugin system as many of my other addons (Universal Content Puller, Omni Gallery, Extreme Clean ...).

The whole system is aimed at easy extension within Form Reform, by third party addons, by agencies and by site building developers.

Handlers can be easily added to do whatever you want with the form data.

Reform where you can save form data

Saving form data with Form Reform is simply a handler in the processing pipeline. You can save to multiple locations or just one location.

If you need to save data elsewhere, such as to a dedicated table, a table provided through another addon, to another database, send it to an API, forward it to another server, or anywhere you can imagine, you can adapt or develop a form handler to do so.

The complexity of the code depends on where you are saving or sending the data, but wrapping that into a form handler plugin for Form Reform is straight forward.

The Form Reform handler plugin system is designed for easy extension.

Form Reform

Reform the way forms are built. Build a form out of blocks. Take control of how form submissions are processed and how the submitted data is stored. Easy to extend. Easy to reconfigure. Tangible data. Easy to add your own integrations.

Form Reform Display

List and display form submissions from Form Reform.

Form Reform UTM

Not just Form Reform and not just UTM! Capture and hold incoming UTM (or other) tags and make the tag values available to Form Reform and/or Conditional Redirect as {{place_holders}}. You don't need Form Reform to use this.

Form Reform Dynamics

Form handlers for querying Microsoft Dynamics, forwarding and updating form data to Microsoft Dynamics.

Snapshot

A suite of advanced image capture and upload tools. Enhanced drag and drop file uploading. Make screengrabs from within Concrete CMS. Capture images directly from device webcams. Edit images before uploading.

Form Reform Attributes, Express and Users

Save submitted forms to Express objects and user attributes. Add and remove users from groups.

Form Reform Image Picker

Form Reform Image Picker provides an image picking input block for Form Reform. The Image Picker Input is preconfigured to connect to most Omni Gallery gallery and slider display widgets, the core gallery block, and thumbnail showing templates for the core page list block. Advanced settings allow the Image Picker Input to be configured to pick images from other galleries and sliders.

Form Reform Data Picker

Form Reform Data Picker provides data picking input blocks for Form Reform. The Table Picker Input is preconfigured to connect to Universal Content Puller table display widgets. Advanced settings allow the Table Picker Input to be configured to pick data from other HTML tables.

Form Reform Macros

Extends Form Reform with form handler macros. Provides a new dashboard page at System & Settings > Form Reform > Form Reform Macros to manage macros, and form handlers to run macros.

Form Reform Developer

A growing suite of resources to assist those developing blocks, handlers and more complex forms for Form Reform.

Learn with a simple form

While you may have plans to implement some much more complex forms using Form Reform, we strongly recommend you start with a simple form such as our contact form example in order to review the basic principles of using Form Reform before you move onto anything bigger.

  1. Start by submitting the form at Getting Started - Your First Form a few times, even making some deliberate mistakes.
  2. Watch our Getting Started with Form Reform video to see how the form is built.
  3. Read through the rest of Getting Started - Your First Form for more details of how this form is built.
  4. Create a test page on your site to build your own version of Getting Started - Your First Form and experiment.
  5. Develop your test page with some of the concepts introduced by our further examples and experiment with some of the other form inputs.