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

SOLVED

How to get adaptive form submit button name in post.POST.jsp

srikanthp689160
Level 4
Level 4

Hi,

Is there a way to get submit button's Element Name value in custom submit actions' post.POST.jsp on an AEM adaptive form?

The usecase is one adaptive form contains two submit buttons with different Element names and in post.POST.jsp the business logic varies for each submit button.

I tried resource object in post.POST.jsp but that gives adaptive form object.

Thanks & Regards,

Srikanth Pogula.

1 Accepted Solution
James_R_Green
Correct answer by
Level 7
Level 7

How about adding rules to the buttons to set a hidden form field to say "submit1" and "submit2" and checking these in your code after submit?

View solution in original post

5 Replies
James_R_Green
Correct answer by
Level 7
Level 7

How about adding rules to the buttons to set a hidden form field to say "submit1" and "submit2" and checking these in your code after submit?

View solution in original post

srikanthp689160
Level 4
Level 4

Hi James,

Thanks for the quick reply.

I tried the above approach but unable to see hidden fields listed while during Set Value of function.

Also am working AEM 6.2 SP1 CFP3 where am unable to find hidden form field component in side panel, any idea if there is any component which is readily available? or should the input hidden field be added at adaptive form template script?

Thanks & Regards,

Srikanth Pogula.

DarrenBiz
Level 7
Level 7

You could try leaving the field normally visible, then hiding it on initialise. That way it should always show in the component side panel in the Rule Editor.

srikanthp689160
Level 4
Level 4

Thanks DarrenBiz and James,

The above approach worked, thanks much for your help.

hari_purushotha
Level 2
Level 2

Hi Srikanth,

I am working on the same scenario.can you please share the code piece in post.POST.jsp and how to configure the hidden field for submit button.