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.

remove field permamently

Avatar

Former Community Member
Hi,

Is it possible that when a user open up a form (reader extended), and upon clicking a button, delete away certain fields in the form, like a textbox or subform. And when user save and reopen the form, the deleted fields will not appear. Possible? Thanks.
4 Replies

Avatar

Former Community Member
If you make the fields hidden then they exist but they are not part of the layout. You will have to store the state of the form so that you can set it when the form opens for the second time.

Avatar

Former Community Member
Hi Paul,

There is a problem, if the user disable java script from the Adobe Reader, he or she will be able to view the hidden fields when the form is opened for the second time. Any solution?

Thank you.

Avatar

Former Community Member
Then the only other way I can think of is to have two different templates and export the data out of the 1st one and import it into the second one. If the fields are not in the second one then the data for those fields is ignored.

Avatar

Former Community Member
Hi Mike,

You can also set a new hidden field value to a new value after the button is clicked. Then in the initialize of the form you can hide those fields by looking at the given hidden value.



//at first

XHidden = 0;



//when button is clicked

XHidden = 1;



if(XHidden == 1)

field1.presence = "hidden";



Asiye