Assigning A 'Go To Page' Action - Adobe 12001196 - Acrobat - Mac Manual

Javascript
Hide thumbs Also See for 12001196 - Acrobat - Mac:
Table of Contents

Advertisement

12.•Click Close in the Text Field Properties dialog.
In Acrobat 5 you would have had to explicitly get each field from the this object and use
the value properties of each field object, as in the following example (equivalent to the
symplified syntax in step 10, above):
var f = this.getField(
var g = this.getField(
event.value = f.value - g.value;
The simplifed field notation makes it very easy to define relatively complex calculations.
Instead of typing:
event.value = ( getField("income.interest").value
the new syntax would require only:
(income\.interest + income\.rental)*0.45 - deductible
Note the backslash (\) before the period or dot (.) in the above example. To avoid
ambiguity, all operators (including the dot in the example), numbers, and whitespace
characters are assumed to separate field names. If those characters are used in a field name,
they may be specified in the Simplified Field Notation by escaping them with a backslash
character, as in the example. Quote characters used in a SimplifiedField Notation script will
be treated as part of a field name.
For even more complex calculations and logic, you can still use the Custom calculation
script choice. Scripts entered in this window require the full object and property syntax.

Assigning a 'go to page' action

If you create a multiple page form, it is useful to add a button that automatically takes you
to the next page. This type of action is most commonly associated with the Mouse Up
action.
The JavaScript you use to take you to the next page at the click of a button can be easily
modified to automatically take you to the previous page of the form, the first page of the
form, or the last page of the form. All these variations are presented in the following
procedure.
To specify a "go to page" action for a button:
1. Select the form tool , and create a form field. (For information, see the section on
Creating Form Fields in the Acrobat online help.) Name this field GoNext.
If you want to create several 'go to page' buttons on the same form, name each field
accordingly: GoNext, GoPrev, GoFirst, and GoLast.
2. Choose Button from the Type menu, and specify the border, background, text, and field
appearances. Click the Options tab, and specify selections as needed. (For more
information, see "Creating interactive buttons" in the Acrobat online help.)
Acrobat JavaScript Scripting Guide
"
ValueA
"
ValueB
+ getField("income.rental").value )*0.45
- getField("deductible").value;
Using Acrobat JavaScript in Forms
"
);
"
);
Creating simple JavaScripts
4
57

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Acrobat 6.0

Table of Contents