
Using Help
|
Contents
|
Index
Back
164
Adobe Acrobat Help
PDF Forms
Using Help
|
Contents
|
Index
Back
164
For information on customizing Acrobat, see the Acrobat Software Development Kit (SDK).
Support for the Adobe Acrobat SDK is provided to members of the Adobe Solutions
Network (ASN) Developer Program. For information on joining the ASN Developer
Program, requesting developer technical support, or obtaining updates to this SDK, refer
to the Developer Support section of the Adobe Web site (partners.adobe.com/asn/
developer/).
Using custom JavaScripts in forms
The JavaScript language was developed by Netscape Communications so you could more
easily create interactive Web pages. Adobe has enhanced JavaScript so you can easily
integrate this level of interactivity into your PDF forms. The most common uses for Java-
Script in Acrobat forms are formatting data, calculating data, validating data, and
assigning an action.
While there are plug-in, document, and field level JavaScripts, we are concerned only with
document level and field level scripts here. For information on plug-in level scripts, see
“Working with JavaScript actions” on page 181
, or choose Help > Acrobat JavaScript Guide
to display the
Acrobat JavaScript Object Specification
.
•
Document level scripts are executed with the document open and apply only to this
document.
•
Field level scripts are associated with a specific form field or fields. This type of script is
executed when an event occurs, such as a Mouse Up action.
Creating simple JavaScripts
There are a number of simple JavaScripts you can integrate into your forms to enhance
their interactive capabilities. The scripts described here are commonly used with Acrobat
forms. Trying out these scripts in the forms you create will give you a glimpse of what
JavaScript offers.
Careful selection of field names when creating forms is an important factor in data
collection. If two fields share the same name, they also share the same value. You can use
this capability to create fields that have different appearances (that is, appear on different
pages and have different background colors) but have the same value.This means you can
modify one field and the other field is updated automatically.
Note:
For more information on JavaScript naming conventions for Acrobat forms, choose
Help > Acrobat JavaScript Guide to display the
Acrobat JavaScript Object Specification.
Creating an automatic date field
Many forms require a date for tracking purposes.The following procedure shows you how
to create a text field that automatically displays the current date when the document is
opened.
The script you create to display the current date when the document is opened is a
document level script.
To create an automatic date field:
1
Select the form tool
, and create a text field. For information, see
“Creating form
fields” on page 145
. Name the field
Today
.