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

Dont want to send form field values in Custom Submit action

Avatar

Level 3

Hi All,

 

We have some form elements and we have a Custom Submit action.

 

We dont want to send some values to afdata(afbound and afunbound) parameters.

 

By default all the values are coming in afdata .

 

Thanks

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

what is the use case for not wanting the data in the submission?

And it is not possible to achieve your use case using OOTB submit action

View solution in original post

6 Replies

Avatar

Community Advisor

@Sb2512 :

 

as a first thing , if you dont want to send the field in the afdata, for those fields dont provide the bindRef  property to that filed.

SivakumarKanoori_0-1678959691839.png

 

if that doesnot work, try below.

In your custom submit component, if you have any clientlibs or in the rules editor  check that , if your submitting data with ajax call.

e.g:

$.ajax({
url: saveUrl,
type: 'POST',
data: formData,
contentType: 'application/json',
});

you might be having some logic to build the formdata which captures all the data which we input in the form. 

you can remove the keys which you dont want from the formData.

Thanks,
Siva

Avatar

Level 3

Hi @SivakumarKanoori 

 

Even if we are not setting the bind Reference the value is coming under unboundReference in afdata.

Avatar

Correct answer by
Employee Advisor

what is the use case for not wanting the data in the submission?

And it is not possible to achieve your use case using OOTB submit action

Avatar

Level 3

We have some confidential fields like bank account Number which we dont want to send on the network Call so we created a Encrypted hidden field where we are encrypting bank account number and sending to the network call but the plain text account number we want to restrict on form submit.

 

Avatar

Community Advisor

@Sb2512 : Are you using OOTB component or Custom component for submit. If its custom component , Can you share the logic here, how you are submitting the data.

Thanks,
Siva

Avatar

Level 3

We are using Custom Submit Action ,

We have some confidential fields like bank account Number which we dont want to send on the network Call so we created a Encrypted hidden field where we are encrypting bank account number and sending to the network call but the plain text account number we want to restrict on form submit.

 

 

 

Sb2512_2-1681472620891.png