Hiding A Field Until A Condition Is Met - Adobe 12001196 - Acrobat - Mac Manual

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

Advertisement

5. To mail the PDF document to the specified e-mail address when the button is selected,
in the script window, enter the following text in the exact format, and click OK:
this.mailDoc(true,
Description
To mail the forms data (only) as an FDF file, use the following script instead:
this.mailForm(true,
Description
6. Click Set Action, and then click OK in the Field Properties dialog box.
Hiding a field until a condition is met
In more complex forms, you might want to have one field that is hidden, or inactive, until a
specific condition is met. For example, a field could be hidden, grayed out, or read only until
a dollar amount greater than a specified number is entered into another field.
In our example, a dollar amount greater than 100 must be entered in the ActiveValue field
to activate the GreaterThan field. The active field is called ActiveValue, and the inactive field
is called GreaterThan.
To activate a field when a condition is met in another field:
1. Select the form tool , and create a text field. (For more information, see the section on
Creating Form Fields in the Acrobat online help.) Name the field ActiveValue.
2. Click the Format tab, and choose Number from the Category list. Choose two decimal
places, Dollar as the Currency Symbol, and the common Separator Style (the default).
Click OK.
3. Create a second text field, and name it GreaterThan.
4. Click the Format tab, and choose Number from the Category list. Choose two decimal
places, Dollar as the Currency Symbol, and the common Separator Style (the default).
Click OK.
5. Double-click the ActiveValue field. Click the Validate tab, select Custom Validation
Script, and click Edit.
6. Here are three variations in the behavior of the GreaterThan field, with the
corresponding code:
– To keep the GreaterThan field hidden until an amount greater than 100 is entered in
Acrobat JavaScript Scripting Guide
"
name@address.com
"
);
"
name@address.com
"
);
the ActiveValue field, in the script window, type in the following in the exact format,
and click OK:
var f = this.getField(
f.hidden = (event.value < 100);
Using Acrobat JavaScript in Forms
"
""
""
"
,
,
,
"
""
""
,
,
,
"
"
GreaterThan
);
Creating simple JavaScripts
Message Subject
"
Message Subject
4
59

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Acrobat 6.0

Table of Contents