These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Toolbar Print Button running my javascript

cbaranski
Registered: Feb 3 2009
Posts: 2
Answered

I have a form that has a Print button I placed on the form. It has javascript that does some verification of the fields, works great.

How do I get this code to run when the user clicks the built in print button on the toolbar? Disabling this button is not an option. I have another form that runs custom code behind the print button; how did they do that?

Thanks!

--
Chris Baranski

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can't change the toolbars print button action, but you can use the pre print event of the form to do something with JS.

The LiveCycle Scripting Basic manual says...

prePrint event
Description
Initiates immediately before the process of rendering a form for printing begins. You cannot cancel
printing using this event.
Caution: Avoid using this event to hide or show form objects. For example, if a form filler has already
digitally signed the form, using this event to hide all button objects prior to printing will impact
the state of the signature.

Example
You can use this event to change the presence of an object to prevent it from printing. For example, you
can use this event to hide text or instructions intended for the form filler to use while filling the form
online.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs