The <form> Tag
Purpose
The <form> tag defines an HTML form (i.e., it is mapped to an HTML <form> element). It is an enhanced version of the <base:form> tag from the Calyxo Base component (with six additional attributes related to validation issues: assertClass, assertStyle, errorClass, errorStyle and create).
Attributes
Attribute groups: %coreattrs, %i18n and %events.
| Name | Description |
|---|---|
| accept | Mapped to the HTML attribute of the same name. |
| action | Required - Module-relative path to the action in the current module, that should be invoked when submitting the form. The tag will transform this into a context-relative path, when it renders the HTML form tag's action attribute. |
| assertClass | Appended to the HTML class attribute of a contained input field, if an assertion concerning that input field failed and if the equally named attribute of the input field is not set. |
| assertStyle | Appended to the HTML style attribute of a contained input field, if an assertion concerning that input field failed and if the equally named attribute of the input field is not set. (Default: "background-color: orange;", but this value is only used if neither the contained input field nor this form have an assertClass attribute value set.) |
| create | If given, must be true or false. The form tag uses the FormsSupport.getFormData(...) method to retrieve the form data instance for its action path. The boolean create parameter instructs the forms support to lazily create a new form data instance, if none is present for the specified path. (Default: false.) |
| enctype | Mapped to the HTML attribute of the same name. |
| errorClass | Appended to the HTML class attribute of a contained input field, if the validation of that input field failed and if the equally named attribute of the input field is not set. |
| errorStyle | Appended to the HTML style attribute of a contained input field, if the validation of that input field failed and if the equally named attribute of the input field is not set. (Default: "background-color: red;", but this value is only used if neither the contained input field nor this form have an errorClass attribute value set.) |
| method | Mapped to the HTML attribute of the same name. |
| name | Mapped to the HTML attribute of the same name. |
| onreset | Mapped to the HTML attribute of the same name. |
| onsubmit | Mapped to the HTML attribute of the same name. |
| target | Mapped to the HTML attribute of the same name. |
Body
The <form> tag requires a body containing the contents of the form (i.e., its input fields, buttons, etc.).


