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

JavaScript tcommand to run JavaScript in another Button

kimkamp
Registered: Apr 25 2009
Posts: 1

Hi!
I have a form with a "Refresh" routine that does calculations, etc.
 
I would like to run that routine from another Button. How do I run the JavaScript in one button, from another button?

My Product Information:
Acrobat Pro 7.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You should place the code in a document-level JavaScript. You can then call the function from as many buttons as you want.

For more info: http://acrobatusers.com/tutorials/2007/07/js_document_scripts
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Using the document level function also makes the function available to any JavaScript action including custom calculations, bookmarks, page actions, print actions, etc. Another advantage is if you import a PDF with document level functions and then delete the imported pages, the document level functions remain in the PDF. So if you carefully design your functions, you can easily reuse them in other PDFs.

George Kaiser