Calculate Properties

The Calculate Properties are specific to the Text Box and Dropdown fields. They enable a field to be calculated based on the contents of other fields in the document. The calculation is invoked whenever the value of the appropriate fields change.

Value Is Not Calculated: This is the default calculation type. It means no calculations will be made.

Calculation Field: Selecting Calculation Field from the drop-down box to make simple calculations based on the contents of the other fields in the PDF.

Simplified Field Notation: Specify the Simplified Field Notation to make more complicated arithmetic calculations. The following is an example of a Simplified Field Notation calculation:

ResultsTextBox = AverageEmployeeSalaryTextBox * NumberOfEmployeesTextBox + TotalEmployeeBonusTextBox–TotalTaxesTextBox

Ultimately, names used in the simplified field notation are replaced with the equivalent JavaScript calculation. For example, this example gets translated into the following JavaScript:

this.getField("ResultsTextBox").value = this.getField("AverageEmployeeSalaryTextBox").value * this.getField("NumberOfEmployeesTextBox").value + this.getField("TotalEmployeeBonusTextBox").value - this.getField("TotalTaxesTextBox").value

Custom Calculation Field: Use this field to specify a Custom Calculation Field using JavaScript. For example, a form may be created letting the user input the amplitude, period, phase shift, vertical shift, and x-coordinate for a sine wave, a Custom Calculation Field might look like:

var amplitude = new Number(this.getField("AmplitudeTextBox").value);

var period = new Number(this.getField("PeriodTextBox").value);

var phaseShift = new Number(this.getField("PhaseShiftTextBox").value);

var verticalShift = new Number(this.getField("VerticalShiftTextBox").value);

var x = new Number(this.getField("XTextBox").value);

 

event.value = verticalShift + amplitude * Math.sin(period * x + phaseShift);