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.

default thank you message

Follow the below steps to configure a custom thank you message for your Adaptive Forms Block:

  1. Access your AEM Project on your local machine or GitHub repository.

  2. Navigate to [AEM Project Folder]\blocks\form\submit.js file for editing.

  3. Locate the following code

    code language-javascript
    
        thankYouMessage.innerHTML = payload?.body?.thankYouMessage || 'Thanks for your submission';
    
  4. 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.';
    
  5. 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,

Custom thank you message

See also

recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab