Form Button Component (v1) form-button-component-v

The Core Component Form Button component allows for the inclusion of a button field in a form to trigger an action.

Usage usage

The Core Component Form Button component allows for the creation of button field, often to trigger the submission of the form and is intended to be used along with the form container component.

The button properties can be defined by the content editor in the configure dialog.

Version and Compatibility version-and-compatibility

This document describes v1 of the Form Button Component, originally introduced with release 1.0.0 of the Core Components with AEM 6.3.

The following table lists the compatibility of v1 of the Form Button Component.

AEM Version
Form Button Component v1
6.3
Compatible
6.4
Compatible
CAUTION
This document describes v1 of the Form Button Component.
For details of the current version of the Form Button Component, see the Form Button Component document.

Sample Component Output sample-component-output

The following is sample taken from We.Retail.

Screenshot screenshot

HTML html

<div class="cmp cmp-button aem-GridColumn aem-GridColumn--default--12">
    <div class="cmp cmp-button">
        <button type="BUTTON" class="btn btn-action btn-primary" name="loveToast" value="ILoveToast">
            Click here if you love toast!
        </button>
    </div>
</div>

JSON json

"container": {
              "columnClassNames": "aem-GridColumn aem-GridColumn--default--12",
              "columnCount": 12,
              "gridClassNames": "aem-Grid aem-Grid--12 aem-Grid--default--12",
              ":items": {
                "button": {
                  "columnClassNames": "aem-GridColumn aem-GridColumn--default--12",
                  ":type": "weretail/components/form/button",
                  "name": "loveToast",
                  "jcr:title": "Click here if you love toast!",
                  "type": "submit",
                  "value": "ILoveToast"
                }
              },
              ":itemsOrder": [
                "button"
              ],
              ":type": "weretail/components/form/container"
            }
NOTE
JSON export from the Core Components requires release 1.1.0 of the Core Components. Please see the compatibility information for Core Components v1 for more information.

Configure Dialog configure-dialog

The configure dialog allows the content author to define the parameters of the button.

  • Type

    • Button
    • Submit
  • Title - The text displayed on the button

    • If none provided it defaults to the button type
  • Name - The name of the button, which is submitted with the form data

  • Value - The value of the button, which is submitted with the form data

Design Dialog design-dialog

There is no design dialog for the Form Button component.

Technical Details technical-details

The latest technical documentation about the Form Button Component can be found on GitHub.

The entire core components project can be downloaded from GitHub.

Further details about developing Core Components can be found in the Core Components developer documentation.

recommendation-more-help
d2be9096-a81e-404b-9952-d8925af7219c