Script Editor

The Script Editor is where you create, modify, and view the calculations and scripts of a particular form. For example, you can use the Script Editor to write a simple calculation that adds two numeric fields or complex scripts that alter the appearance of the form based on end-user actions. Designer supports scripting either in its own scripting language called FormCalc or in JavaScript.

By default, the Script Editor appears at the top of the Designer workspace, but you can dock it anywhere. It has both a single-line view and a multiline view that you can switch between, depending on your needs. Single-line view is designed to maximize the amount of space dedicated to the Layout Editor and other palettes. Multiline view is designed to maximize the amount of space for writing script.

Show
Lists all form design events that support user-defined scripting. Any events that do not apply to a particular object appear dimmed. Events that contain a calculation or script display an asterisk (*) beside the name of the event.

Show Events for Child Objects
 Displays the event you have currently selected in the Show list for the current object and all of its child objects. If you select the uppermost object in the Hierarchy palette, this option displays the event you have currently selected in the Show list for all objects on your form.

Functions
 Displays a list of available built-in FormCalc or JavaScript functions, depending on the scripting language you currently have selected in the Language list.

To place a function onto your script editing field, select a function from the list and press Enter.

Check Script Syntax
 Checks all of the scripts in a form for correct syntax and reports any errors on the Warnings tab in the Report palette.

Language
Specifies the scripting language you want to use for the current calculation or script. Two options are available:

The scripting language that is displayed in the Language list matches the scripting language option you select as the default for new forms in the Workspace panel in the Options dialog box. However, if you change the scripting language setting for the current form on the Defaults tab in the Form Properties dialog box, the scripting language that is displayed in the Language list changes similarly for any new scripts on new events. Changing the scripting language option in the Form Properties dialog box does not change the scripting language for existing scripts. If an event already contains script and that script is deleted, the Script Editor continues to use that same scripting language for the duration of your Designer working session.

Run At
Specifies where the calculation or script will execute. Three options are available:
  • Client Calculations and scripts execute while the client application (for example, Acrobat, Adobe® Reader®, or a web browser) processes the form.

  • Server Calculations and scripts execute while the server application (for example, Adobe® LiveCycle® Forms 10 processes the form.

  • Client and server Calculations and scripts execute while the server application (for example, Forms) processes the form, except in cases where the HTML client application supports client-side scripting. For example, a script that accesses a database to prefill data on a form.

Event Propagation
To see the Event Propagation checkbox go to Tools > Options dialog and in the Workspace tab, select the Display Event Propagation Option checkbox.
You can make your scripts global, by enabling event propagation in the Script Editor. The setting allows form events to propagate to ancestor containers. Event propagation can reduce the number of scripts in a form. For example, you can create a global script to control the appearance of invalid fields, subforms, or exclusion groups. A few examples of global events are:
  • An enter/exit/mouseEnter/mouseExit event that colors the active field.

  • A change event that track keystrokes for a form session.

// Ethnio survey code removed