Subform

Description

Subfrom allows parts of a form to be submitted to different destinations.

Documentation

The subform pattern on a subset of controls in a form. It is enabled by class "pat-subform" on grouping elements of the form.

The most basic example:

Both buttons will submit the form with a page load to the action and method specified on the form. The global button will submit the whole form, the local button will only submit the contents within the subform.

The form and/or subform can have "pat-autosubmit" installed to submit their respective form-data automatically upon input:

In the above example both buttons were replaced by an automatic submission. Instead of a page load parts of the form can be submitted by injection:

This would submit the form via an ajax call and inject the answer into the page. The subform would still be submitted via a page load. This example can also be reversed:

Now the contents of the subform are submitted via ajax while the form is send via a page load. Of course also both form and subform can be submitted via injection.