Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

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.