Configuring Designer for Scripting

To show the Script Editor

 Select Window > Script Editor.
Note: You can use the Expand button to quickly dock or undock the Script Editor when it is displayed in the Designer workspace.

To change from single-line to multiline view

 Drag the Script Editor palette bar until the palette is the required size.
Note: Multiline view adds the All Events and Events with Scripts options to the Show list. The All Events option displays all of the events for a particular form design object, even if the events do not contain any calculations or scripts. The Events with Scripts option displays only those events of a particular object that contain calculations or scripts.

To set the default scripting language for new forms

  1. Select Tools > Options.

  2. Click Workspace.

  3. In the Default Language For New Forms list, select the default scripting language for new forms.

To set the default scripting language for the current form

  1. Select File > Form Properties.

  2. Click the Defaults tab.

  3. In the Default Language list, select the default scripting language for the currently displayed form.

To set the default scripting language for a form template

  1. Create a new form design.

  2. Select File > Form Properties.

  3. Click the Defaults tab.

  4. Select your default scripting language from the Default Language list.

  5. Make a backup of the original form template file located in the Templates folder where Designer is installed.

  6. Save the new form design as a TDS file and overwrite the corresponding form template. For example, save the file as Letter.tds and overwrite the Letter.tds file located in Templates\Blank folder.

To set the default processing application

  1. Select File > Form Properties.

  2. Click the Defaults tab.

  3. Select your default processing application from the Default Run At list.

    Note: This procedure only sets the value of the default processing application for the current instance of the form.

    To avoid changing the default processing application each time you create a form, you must modify the corresponding form template file that is used to create a new form design.

To change the default processing application for a form template

  1. Create a new form design.

  2. Select File > Form Properties.

  3. Click the Defaults tab.

  4. Select your default processing application from the Default Run At list.

  5. Make a backup of the original form template file located in the Templates folder where Designer is installed.

  6. Save the new form design as a TDS file and overwrite the corresponding form template. For example, save the file as Letter.tds and overwrite the Letter.tds file located in Templates\Blank folder.

To display Arabic, Hebrew, Thai, and Vietnamese characters

To display Arabic, Hebrew, Thai, and Vietnamese characters in the Script Editor or XML Source tab, you must change the font settings that Designer uses in these tabs. Otherwise, Designer displays rectangles where the language-specific characters should be.

  1. Select Tools > Options and select Workspace from the list on the left.

  2. Select one of the following options:

    • FormCalc Syntax Formatting to set the font in the Script Editor when you use FormCalc

    • JavaScript Syntax Formatting to set the font in the Script Editor when you use JavaScript

    • XML Source Syntax Formatting to set the font in the XML Source tab

  3. In the Font box, select a font that supports your language. For example, Adobe Arabic supports Arabic, Adobe Hebrew supports Hebrew, Adobe Thai supports Thai, and Myriad® Pro and Minion® Pro support Vietnamese. You can locate the font you need for your language on the Internet if it is not already on your system.

  4. Click OK.

  5. Click OK to close the Options dialog box.

Using the workspace to debug calculations and scripts

The Designer workspace provides a number of ways to assist you with debugging your calculations and scripts.

The following table provides the location and purpose of some helpful debugging information located on various Designer palettes and tabs.

Workspace location

Purpose

Warnings tab in the Report palette

Displays target and warning marker messages as well as all JavaScript or FormCalc scripting syntax errors when you select the Check Script Syntax command from the Tools menu or click the Check Script Syntax button in the Tools toolbar. For more information, see To check script syntax.

When you double-click a syntax warning message in the Warnings tab, the script that contains the error is loaded into the Script Editor, and the line with the error is highlighted.

You can also double-click a warning message to select the related object in the Design View and the Hierarchy palette, and press F1 to display information about how to fix the warnings.

To check for JavaScript run-time errors, you can activate the JavaScript Console. For more information, see JavaScript Debugging.

Binding tab in the Report palette

If you include fields on your form design that are bound to a data source, the Binding tab can assist you by displaying lists of fields based on how you defined their data binding. For example, you can list only fields with Global Data Binding or only those with no data binding defined. This feature is especially useful on forms that have a large number of data bound fields.

Log tab in the Report palette

Displays validation messages, JavaScript or FormCalc scripting execution errors, and design-time form rendering errors generated by Designer when you import or save a form, or preview a form using the Preview PDF tab.

Hierarchy palette

You can use the Hierarchy palette to determine the location of a form object for a reference syntax. The Hierarchy palette is a graphical representation of the structure of a form. It displays the contents of the Master Pages and Design View tabs.

The Hierarchy palette also displays referenced objects under the Referenced Objects node. A referenced object is an object that is added to a form only when it is required. Whenever data flows across multiple pages or content areas, the overflow leader and trailer subforms are inserted into the form in the appropriate places.

Binding tab in the Object palette

Every Designer object that can be bound to a data source includes a Binding tab in the Object palette. If you bind an object on your form design to a particular data node from your data connection, the Data Binding (Open, Save, Submit) list displays a valid FormCalc reference syntax for accessing that data node. You can use the FormCalc reference syntax in other calculations or scripts for testing purposes.

XML Source tab

The XML Source tab contains the form design’s XML code. The XML source code defines all aspects of the form. You can use the XML Source tab to view the XML Form Object Model structure of a form design and to understand the relationships between objects and properties. In the XML source, the XML element names are equivalent to the object names in the XML Form Object Model, and attributes are equivalent to properties.

When you select an object in the Hierarchy palette and then click the XML Source tab, the first line of the corresponding element is highlighted. The object name in Designer, as listed in the Hierarchy palette, becomes the value of the name attribute in the XML source.

You can set options in the Tools > Options dialog box for viewing the source in the XML Source tab, such as showing or hiding line numbers and setting the syntax coloring.

It is recommended that you do not edit the XML source code directly.

You may also find it useful to change the default options for the Script Editor to make it easier to debug your calculations and scripts. These options are in the Workspace panel of the Options dialog box, which is available by selecting Tools > Options and then selecting Workspace from the list on the left. For example, you can choose to display line numbers in the Script Editor or change the formatting of FormCalc or JavaScript syntax.

// Ethnio survey code removed