Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to pass response data from internal/external servlet to successful/error event of form submission validation?

Avatar

Avatar
Validate 1
Level 1
yuvraj1610
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
yuvraj1610
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
yuvraj1610
Level 1

13-09-2020

Hi All,

 

I am using ootb form submit action - 'Submit to Rest Endpoint'.

 

  • I am able to hit my post servlet using this submit action.
  • My servlet is returning a response data for eg : "data". It can be any data json or string.
  • On the adaptive form container, I have selected "Use Asynchronous Submission
  • I am using "Form Submission" event on the rule editor of form container.

 

How can I get the response data in my front end javascript which I am writing in rule editor of a form submission event or if not in rule editor what is the best way to get the response data?

 

I know I can write the rule on click event of the submit button and directly hit my servlet and get the response but I want to use Submit action(post.Post.jsp) to achieve it. Is there any way?

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
yuvraj1610
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
yuvraj1610
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
yuvraj1610
Level 1

15-09-2020

I was able to resolve this issue by setting the thank you page URL and the value should be the same as the source page URL where the form is present.

Answers (2)

Answers (2)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct Reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

14-09-2020

@yuvraj1610  You can make AJAX call to your post servlet in AEM forms rule editor. Just take care of CORS

 

https://api.jquery.com/jquery.post/

 

http://www.aemcq5tutorials.com/tutorials/aem-forms/implement-autocomplete-adaptive-form/

Avatar

Avatar
Give Back
Level 3
Kosta_Prokopiu
Level 3

Likes

15 likes

Total Posts

52 posts

Correct Reply

9 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Give Back
Level 3
Kosta_Prokopiu
Level 3

Likes

15 likes

Total Posts

52 posts

Correct Reply

9 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Kosta_Prokopiu
Level 3

14-09-2020

You have chosen the asynchronous submit and it sounds as if you want to handle it individually. This link describes your use case - maybe that will help

https://docs.adobe.com/content/help/en/experience-manager-65/forms/adaptive-forms-advanced-authoring...

The event of the Submit button might not be the correct place. I think that needs to happen on Form level.