Publishers of technology books, eBooks, and videos for creative people

# Creating Auto-Calculating Form Fields

• Print
From the author of

### From the author of 

Setting the “Wakeups Charge” Calculation

## Setting the “Wakeups Charge” Calculation

If we double-click on the Wakeups Charge field, Acrobat shows us the Text Field Properties dialog box for the field (Figure 6). This dialog box dictates the appearance and behavior of the field; we’re going to use its Calculate tab (Figure 7) to specify that the field should calculate its own value and to tell it exactly how it should do so.

Acrobat makes it surprisingly convenient to specify a field’s calculation; in effect, we construct an English sentence that describes the computation. In our case, that sentence will be “The value is the product of the following fields: Wakeups Count; Wakeups Rate.”

Couldn’t be clearer.

We assemble this sentence with a radio button, a pop-up menu, and a text box (Figure 8). Here’s the procedure, step by step.

1. Select the “Value is the…” radio button; this enables the other two controls we need.
2. Select “product” in the pop-up menu.
3. Acrobat now knows it needs to multiply the values of the fields listed in the text box. We could just type the field names into the text box with our keyboard, but I’m pretty thumb-fingered; I’d have to retype each name at least twice to get it right. It’s much easier to choose the fields from a list.

4. Click the Pick button and select the fields you want (Wakeups Count and Wakeups Rate, in our case) in the resulting list (Figure 9).
5. Click the OK button. Acrobat will add the selected form fields to the calculation text box (Figure 10).
6. The dialog box now describes our calculation in English; click the Close button to tell Acrobat you’re finished with the dialog box. (Idle question: Why isn’t this an OK button, as it is practically everywhere else? Just because, I expect.)

7. Click on the Close Form Editing button in the Forms panel (Figure 11) to leave the Form Editor and return to normal mode.

We’re done! We can now see our functioning calculated form field in all its majesty (Figure 12). Put any value into the Count field, press the Tab key to leave the field, and the total charge will recalculate itself to reflect the new value.

So far, so impressive. However, we’re not quite done; we can still improve the “Standard Wake-ups” part of the form.