PDF Forms Using Acrobat and LiveCycle Designer Bible (Bible #545) by Ted Padova & Angie Okamoto

PDF Forms Using Acrobat and LiveCycle Designer Bible (Bible #545) by Ted Padova & Angie Okamoto

Author:Ted Padova & Angie Okamoto
Language: eng
Format: epub
Publisher: John Wiley & Sons


To format the field for changing text color, we use the text field's Format tab and write a custom JavaScript. Here's how to do it.

For these steps, use the globalTransferFields.pdf form found in the Chapter 17 folder on the book's CD-ROM.

STEPS: Changing Text Colors

1. Open a form in Acrobat. In our example, we used the globalTransferFields.pdf form from the book's CD-ROM.

2. Open the US Dollars Text Field Properties window. Using the Select Object tool, double-click the US Dollars text field.

3. Open the Format tab. Click Format in the Text Field Properties window.

4. Open the Custom Format options. Choose Custom from the Select format category drop-down menu.

5. Open the JavaScript Editor. In the Custom Options of the Format tab, you have two areas where you can use a JavaScript. The top item is the Custom Format Script area. We want to use this option to add our script for custom formatting. Click the first Edit button adjacent to the Custom Format Script window shown in Figure 17.11 to open the JavaScript Editor.

6. Add the following script in the JavaScript Editor:

1. var f = event.target;

2. if (f.value > 10000)

3. f.textColor = color.red;

4. else

5. f.textColor = color.black;

7. Click OK in the JavaScript Editor. You return to the Format tab in the Text Field Properties window. When you return to the Format tab, the script appears in a scrollable window, as shown in Figure 17.11.

8. Click Close, and save the file.

FIGURE 17.11

Add a JavaScript to the Custom Format Script area in the Format tab.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.