Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

AEM Adaptive Forms-Unable to redirect user to thankyou page

Avatar

Level 4

Hi,

I am using aem adaptive forms so that end user can answer few questions and on submit, is shown relevant results on a different page.

Below are the steps followed during implementation:

  1. Created an adaptive form under http://<<server name>>:<<port number>>/editor.html/content/forms/af/us/en-us/my-form.html
  2. Created a custom submission action under /apps/custom_submit_action, business logic to invoke sling service to get results is added in post.POST.jsp
  3. Approach is to set result object as an attribute in request and access it on results page and display results.
  4. Adaptive Form Container is configured with custom submit action and Thank You Page as results page for example http://<<server name>>:<<port number>>/editor.html/content/forms/af/us/en-us/my-form-results.html​
  5. Dropped AEM Form Component(available OOTB) on a sites page, to embed above adaptive form.
  6. On form submit, user is not redirected to results/thank you page, don't see any exception either.
  7. Do i need to configure Thank You Page url in AEM Form component as well? If i do see below exception

               java.lang.IllegalArgumentException: Not a valid identifier 'index,index.html'

Request you to let me know if this approach is correct or not.

Reason for creating adaptive form and embedding it on sites page is because only a certain user group must have access to create and maintain adaptive forms while normal authors must have permissions only to use/import adaptive forms on sites page.

Thanks & Regards,

Srikanth Pogula.

1 Accepted Solution

Avatar

Correct answer by
Level 1

In AEM Form component, when you select Thank you page option, it shows a check box "Refresh Page on submission". You need to select that so that on submission, the entire page is redirected rather than just containing div or IFrame.

View solution in original post

7 Replies

Avatar

Level 10

There is an option when setting up the Adaptive form to set a Thank you page - did you see that?

Avatar

Level 4

Hi,

When i configure thank you page on AEM Form component, thank you page is embedded within form page not a redirect or forward i.e. i see two headers, two footers and thank you page content is in between. Am i missing anything here?

The main issue i see is while functionality works perfectly fine on standalone adaptive form page but when i embed the same form on a sites page using OOTB AEM Form component (fd/af/components/aemform), submission does not work.

Thanks & Regards,

Srikanth Pogula.

Avatar

Level 1

Hi Srikanth,

 

I'm facing the same problem, even after checking refresh page on submission and checking and form covers entire width chckbox. still the thankyou page is not loading. please refer to attached  adobe q.PNG

Avatar

Level 4

Hi,

Can any expert on Adaptive forms suggest a solution here.

Thanks & Regards,

Srikanth Pogula.

Avatar

Correct answer by
Level 1

In AEM Form component, when you select Thank you page option, it shows a check box "Refresh Page on submission". You need to select that so that on submission, the entire page is redirected rather than just containing div or IFrame.

Avatar

Level 4

Hi deep.bhu,

Thanks for the reply.

Able to redirect user to thank-you page on form submission when adaptive form is embedded on a geometrixx-gov page using static template but does not work on our project specific editable template, gives below exception

org.apache.sling.scripting.sightly.SightlyException: Identifier com.day.cq.wcm.foundation.TemplatedContainer cannot be correctly instantiated by the Use API

Is there any limitation that adaptive forms cannot be embedded on pages created using editable templates?

Thanks & Regards,

Srikanth Pogula.

Avatar

Level 4

Hi All,

Able to resolve the above issue by following deep.bhu's solution to select the check box "Refresh Page on submission" to be able to redirect user to thank you page and select another checkbox "Form covers entire width of page" to remove iframe so that user is redirected to thank-you page but not embedded on form page.

Thanks everyone for the help.