Skip to content

Form Area

When a section, column or sublayout is defined as a form area, within the element Advanced Tab panel, it is enclosed with a standard <form\> HTML element without losing builder capabilities. Forms are dynamic in nature as it is YOOtheme Pro builder with dynamic content. Essentials forms builds up on both to create a dynamic data workflow before and after a submission.

Form Area Shortcut

For every form area a paper-plane icon will appear in the builder's main panel to both state that the element is a form area as well as to allow directly opening its configuration panel when clicked.

Actions

After Submit Actions, or simply actions, are multi-instance functions that will run sequentially after a form has been successfully submitted. Consult the After Submit Actions section for more details.

Form Area Actions

Hooks

Form Area Custom Scripts

EventScope VariablesDescription
Before Submissionevent, formExecutes before the submission allowing to prevent it.
After Submissionevent, form, data, responseExecutes after successfull submission.
On Field Changeevent, form, field, dataExecutes after any form field value has changed.
On Submission Errorevent, form, data, errors, validationExecutes after server side submission error, including validation errors.
On Validation Errorevent, form, dataExecutes after front-end validation error.

TIP

For more advanced integrations and details consult Form Events section.

Settings

Form Area Settings

SettingDefaultDescription
After Submit Actions[]List of actions to execute after a successful submission. At least one action is necessary.
HTML 5 ValidationtrueWhether to execute front side HTML5 validation before submission. Server side validation is always executed.
Reset After SubmittrueWhether to reset the form to it initial state after a successfull submission.

Note

For field specific validation refer to elements field settings.

Form Area Errors Display

SettingDefaultDescription
Display in ModalfalseWether to display server side errors in a Modal instead of the bottom block.
Modal ContentThe content to be displayed in the modal, use {errors} as placeholder for the list of errors.
Center ModalfalseWether to vertically center the modal.

Form Attributes

SettingDefaultDescription
NameA custom name attribute for the form dom node.
IDA custom ID attribute for the form dom node.
ClassCustom classes for the form dom node.

Form Action Override

SettingDescription
Action URLThe URL where the form should submit the data to.
Action MethodThe method that should user for submitting the data, GET or POST.

Side Effects

Notice that when a custom action URL is set, server-side validation and after submit actions will not be executed.

Data Placeholders

Data placeholders are plain string references to the submitted data based on their control names. For instance, if there is an input field with the control name email, the placeholder reference would be {email}. These placeholders can be placed in action settings and will be replaced with the submitted data value during the action execution.

Form Data Placeholders

As a quick reference a list of available placeholders can be accessed by clicking the Placeholder Button.

TIP

For a more advanced data workflow combine a composed source with a forma area dynamic source.

Form Source

For each form area, a dynamic content source is created as an alternative, and more convenient, way of accessing submitted data during actions configuration. As a dynamic source, it has all the advantages of YOOtheme Pro Dynamic Content, like the ability to alter the submitted data with filters.

The mapping option for the form area source will be listed as part of each field Dynamic options under the Submission Group.

Form Dynamic Content

Validation

For a form data to be submitted it must pass the fields validation as well as the CAPTCHA validation, if any present. The validation is first run in the browser, and once again via server-side ajax request.

Each field has its own validation rules which can be set independently under the element Validation Tab settings. For more information and integration details, refer to elements documentation.

Custom Error Message

At the moment, it is only possible to customize the validation error messages for server-side validation, not for HTML5 validation. A workaround is to disable HTML5 validation in the Form Area configuration.