11.2.1 for Windows

Table Of Contents
Foxit PDF Editor
Chapter 9: Forms User Manual
314
Variable definitions: Define variables at the document level to make them visible
to any executing script.
Function definitions: Define functions at the document level that support the user
interaction with the document. These functions may be utility functions for
handling common tasks for string or number manipulation, or functions that
execute lengthy scripts called by actions initiated by a user interacting with form
fields, bookmarks, page changes, etc.
To create or access document level scripts in Foxit PDF Editor, select Form >
JavaScript > Document JavaScript. The pop-up JavaScript Functions dialog box (or
an external JavaScript editor if you have specified one in File > Preferences >
JavaScript) enables you to add, edit, or delete document level scripts. All the
document level scripts are stored within the PDF document.
In JavaScript Functions dialog box, you will see the following buttons:
Close Closes the dialog box.
Add After typing a new Script Name, a JavaScript Editor dialog box pops up. You
can create and edit document level scripts here. To change the font of JavaScripts,
click the Font button.
Edit The JavaScript Editor dialog box pops up, enabling you to modify the
JavaScripts you create.
Delete Delete the JavaScript you selected.
Document Action
You can create the document-level JavaScript actions that apply to the entire
document. For example, selecting Document Did Save runs the JavaScript after a
document is saved.
JavaScript Console
JavaScript Console is a control panel for the execution and debugging of JavaScript
code. Serving as a debugging aid, it is quite useful for displaying debug messages and
executing JavaScript. To active the JavaScript console, select Form> JavaScript >
JavaScript Console, and do the following: