ptg
241
Everybody uses forms, and Acroforms makes it simpler than ever to cre-
ate, distribute, and manage forms. Aside from the usual information-type
form, such as attendance, surveys, and so on, a large number of the forms
commonly used have some type of calculations. Basic calculations using
form fields aren’t that difficult, once you get the knack.
Before you start, evaluate the names of the fields Acrobat adds auto-
matically and change them as necessary, following the steps described in
#87, “Working in Form Edit Mode.” Review the names as well, and rename
if necessary (check out the sidebar “What’s in a Name?” for some tips).
There are several situations you’ll commonly encounter when build-
ing a form. In all cases, let’s assume the fields are added and named, and
you’re working in the Form Edit mode:
Using a special format. You want your form information to appear
in the correct format, and using the proper range of values, such as a Zip
Code field. In the Text Field Properties dialog, click Format. Formatting can
range from numbers to currency to dates.
From the “Select format category” pop-up menu, choose Special to
display a list of
masks
(structured field inputs having a preconfigured
arrangement of characters and spacing), and click Zip Code. In the form,
if a user tries to tab out of a field without adding the correct number of
digits, a JavaScript warning displays (
Figure 89a
).
Figure 89a
Use a special format to decrease errors in the form.
Validate the content added. You can restrict what your user enters
in a field, such as a number or characters added in Text Box fields. In
many fields, you need to make selections in more than one tab in order
to be able to validate the field’s contents. A Tax ID# on an invoice is a
#89:
Adding Calculations and Field Behaviors
What’s in a Name?
When it comes to form fields,
the answer is, “Plenty.” If you
are using a simple form, it’s
no big deal to reference the
fields visually and associ-
ate them with their labels
and purposes. By contrast,
a poorly named set of 200
form fields is a migraine
waiting to happen.
Decide on the naming struc-
ture based on the purpose of
the form. For example, if you
are building an order form,
each row of the form usu-
ally relates to the item being
ordered. So, you might use
item01
in
row01
to iden-
tify the product,
item02
in
row02
for the second prod-
uct, and so on. The color
for the first item could be
color01
, and its size named
size01
, and so on.
Similarly, look for totals
that make sense. Using the
same example, if there are
different prices for
item01
based on the customizations
offered, the
Total
column
may contain
item01-total
as the price for the first item
and its extras.
From the Library of Daniel Dadian
Summary of Contents for ACROBAT 9 Extended
Page 1: ...From the Library of Daniel Dadian...
Page 4: ...Dedication For Pippi From the Library of Daniel Dadian...
Page 31: ...This page intentionally left blank From the Library of Daniel Dadian...
Page 75: ...This page intentionally left blank From the Library of Daniel Dadian...
Page 111: ...This page intentionally left blank From the Library of Daniel Dadian...
Page 137: ...This page intentionally left blank From the Library of Daniel Dadian...
Page 217: ...This page intentionally left blank From the Library of Daniel Dadian...
Page 241: ...This page intentionally left blank From the Library of Daniel Dadian...
Page 269: ...This page intentionally left blank From the Library of Daniel Dadian...
Page 309: ...This page intentionally left blank From the Library of Daniel Dadian...