• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 10. Forms > Using Calculated Fields

Using Calculated Fields

Acrobat 7 lets you define a field that displays the results of a calculation using data from two or more other fields. Suppose that your form has several fields in which a user enters dollar amounts. You can define a Total field to display the sum of the entered values. The simplest calculations (Sum, Product, Average, Minimum, and Maximum) are available only for text fields and combo boxes. For more complex procedures, you can use JavaScript to define a custom calculation script. A discussion of JavaScript is beyond the scope of this book, but you can get help from other sources. Acrobat's Help menu offers some assistance; just enter “JavaScript” in the Search field. A more comprehensive source is John Deubert's Extending Acrobat Forms with JavaScript (Adobe Press, 2003), or you can download the “Acrobat JavaScript Object Reference” from the Adobe Web site (www.adobe.com).

To create a calculated field

Select the Text Field tool from the Forms toolbar.

Drag a box to create the calculation field.

When you release the mouse button, the Text Field Properties dialog box opens.

On the General tab (Figure 10.36), enter a name and tool tip description. Set options on the Appearance tab as well.

Figure 10.36. On the General tab, give the field a name and a tool tip description.

Click the Format tab. Choose Number from the Select Format Category pop-up menu (Figure 10.37).

Figure 10.37. Choose Number for the format category.

Enter the number of decimal places, how you want the numbers separated, the currency style, and how you want a negative number displayed.

Click the Calculate tab.

Select the second radio button from the top and choose Sum from the pop-up menu. Click the Pick button to choose which fields you want to calculate.

This brings up the Field Selection dialog box (Figure 10.38).

Figure 10.38. Specify which fields are to be calculated by checking fields.

The Field Selection dialog box lists all of the created fields, buttons, signatures, check boxes, and radio buttons in the PDF document. Choose which fields are to be calculated by checking or unchecking specific fields.

Click OK to return to the Text Field Properties dialog box.

Click Close to set this field as a calculated field.

Now when you enter amounts in the selected fields, Acrobat calculates the sum of the values in those fields.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint