How to get adaptive form submit button name in post.POST.jsp | Community
Skip to main content
srikanthp689160
Level 4
Apr 10, 2018 5:56 AM UTC
Solved

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

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
James_R_Green
James_R_GreenAccepted solution
Level 6
Apr 10, 2018 7:12 AM UTC

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?

5 replies

hari_purushotha
Level 2
May 23, 2018 2:49 PM UTC

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.

Translate
srikanthp689160
Level 4
Apr 11, 2018 6:18 AM UTC

Thanks DarrenBiz and James,

The above approach worked, thanks much for your help.

Translate
DarrenBiz
Level 6
Apr 10, 2018 11:43 PM UTC

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.

Translate
srikanthp689160
Level 4
Apr 10, 2018 10:11 AM UTC

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.

Translate
James_R_Green
James_R_GreenAccepted solution
Level 6
Apr 10, 2018 7:12 AM UTC

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?

Translate