Show a custom thank you message after form submission
After a user submits a form, it’s crucial to provide a seamless experience through a thank you message. This not only confirms successful submission but also enhance user satisfaction and guide them further in their journey.
Configuring a custom thank you message
The default behavior of Adaptive Forms Block is to display the following thank you message on submission. The message is displayed on the top of the form.
Follow the below steps to configure a custom thank you message for your Adaptive Forms Block:
-
Access your AEM Project on your local machine or GitHub repository.
-
Navigate to [AEM Project Folder]\blocks\form\submit.js file for editing.
-
Locate the following code
code language-javascript thankYouMessage.innerHTML = payload?.body?.thankYouMessage || 'Thanks for your submission';
-
Replace the default message with your custom message. For example,
code language-javascript thankYouMessage.innerHTML = payload?.body?.thankYouMessage || 'Your submission has been received and noted.';
-
Save the file. Commit the updated file to your GitHub Repository. Now, when you submit a form, the custom thank you message is displayed. For example,
See also
- Get started with AEM Forms Edge Delivery Services
- Create a form using Google Sheets or Microsoft Excel
- Set up your Google Sheets or Microsoft Excel files to start accepting data
- Publish your form and start collecting data
- Customize the look of your forms
- Add repeatable sections to a form
- Show a custom thank you message after form submission
- Adaptive Form Block components and their properties