AEM Forms allows form developers to seamlessly embed adaptive forms in an AEM Sites page or a web page hosted outside AEM. The embedded Adaptive Form is fully functional and users can fill and submit the form without leaving the page. It helps user remain in context of other elements on the web page and simultaneously interact with the form.
In AEM Sites page, you can add an Adaptive Form using:
AEM Forms Container component
AEM Forms provides a component that you can add to your site pages. The AEM Forms Container component lets you embed an Adaptive Form.
Asset browser
All the forms are available under Assets. You can drag-drop the form as an asset on your page.
To embed an Adaptive Form in an AEM Sites page that uses an editable template, ensure that the AEM Form component is configured as an allowed component in the associated template.
In case AEM Forms Container component is not visble in the Component browser panel of AEM sites page, perform the following steps as illustrated in the video.
In case Sites page is using a static template, you need to configure it in the paragraph system of the site page.
To embed an Adaptive Form using AEM Forms Container component:
Open the AEM sites page, in edit mode, in which you want to embed an Adaptive Form.
From the Component browser panel, drag-drop the AEM Forms Container component on the page. Alternatively, you can search for an Adaptive Form in the Assets browser and drag-drop it onto the Sites page. It embeds the form in an AEM Forms Container. You can create and add a new Adaptive Form or Embed an existing Adaptive Form.
Multiple AEM Forms Container components on a page are not supported.
To create and embed a new form, on the component toolbar, tap the Create Form icon. A window to create the new form opens.
Tap the embedded AEM Forms Container component in the sites page, and then tap on the action bar. The Edit AEM Forms Container dialog opens.
In the Edit AEM Forms Container dialog, specify the following.
Asset Type: Select the type of asset to embed.
Show
Thank You Message: Write a message using the rich text editor to show on form submission. This option is available only when you choose to show a thank you message.
Thank You Page: Browse and select the page to display on form submission. This option is available only when you choose to show a thank you page.
Save the settings. The Adaptive Form is now embedded in the page.
AEM site also allows you to create an Adaptive Form on the fly using the AEM forms container component. Follow the steps to create an Adaptive Form using AEM Forms container component on AEM sites page:
Open the AEM sites page, in edit mode, in which you want to embed an Adaptive Form.
From the Component browser panel, drag-drop the AEM Forms Container component on the page.
Click on the Plus icon and you will be redirected to the form creation wizard.
When an Adaptive Form is created, you are redirected to the AEM sites page and the created form renders at the AEM sites page.
Let’s consider the following scenarios for publishing an embedded Adaptive Form in AEM sites page:
AEM sites page maintains a reference to the Adaptive Form in the AEM Forms Container. Therefore, all configurations and properties, such as the theme, styles, and submit action, configured in the original Adaptive Form are retained in the embedded Adaptive Form .
To modify any configuration or property of the embedded Adaptive Form, do one of the following.
The changes made in the original Adaptive Form automatically reflect in the embedded form. However, republish the Adaptive Form, or the site page to reflect the changes in the published page.
Do keep the following points in mind when embedding adaptive forms in AEM sites pages: