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.

Changing presence to hidden before emailing

Avatar

Level 3

I have created a form in Designer that will be filled out and then emailed as a PDF (locked).  The form includes several checkboxes.  I was able to write a script that changed the presence of unchecked objects to "hidden" on the preprint event, but I am unable to accomplish this same task on the presubmit event.  I am trying to clean up the form by eliminating any irrelevant information before it is submitted.  Any suggestions?  Thanks much (go easy on me, I'm relatively new :-)

2 Replies

Avatar

Former Community Member

A quick and dirty...add a second button that calls the email or print buttons.

// form1.page1.subform1.clickEmailBtn::click - (JavaScript, client)

form1.page1.subform1.cb1.presence = "hidden";

form1.page1.subform1.emailBtn.execEvent("click");

Steve

Avatar

Level 3

Thank you Mr. Walker.  I was hoping to accomplish this without adding another button.  The script works really well in preprint; when I hit "print" all the irrelevant information disappears.  I was hoping to use a similar script in presubmit, but it doesn't seem to work.