You’re here >
PDF form fields
|
This document explains how to manage PDF form field properties, such as adding tooltip, date & time, required or not-required fields, multiline text, and calculated values in Acrobat. (If you’re looking for more information on form fields properties, click the appropriate link above.)
Add a tooltip to a form field
Meaningful tooltips can help users fill your form easily. To add a tooltip to a form field, do the following:
-
Double-click a selected form field to open the Properties window.
-
In the General tab, type a description into the tooltip box.
-
Click Close.
Set a form field as required or not required to fill
To set the field as read-only, required or not required, do the following:
-
Double-click a selected form field to open the Properties window.
-
In the General tab,
- To set the field as read only, select Read Only.
- To set the field as mandatory to fill, select Required.
- To set the field as not mandatory, deselect Required.
-
Click Close.
Add date and time fields
While you are preparing the form in Acrobat, click the Date field icon in the toolbar, and then click the location in the document where you want to place the field.
To specify the time along with date, double-click the Date field to open the Properties window. In the Format tab, choose the date and time format, and click Close.
Add an image field
While you are preparing the form in Acrobat, click the Image Field icon in the toolbar, and then click the location in the document where you want to place the field.
Add a multi-line text field
To add a multi-line text field, do the following:
-
While you are preparing the form in Acrobat, click the Add Text icon in the toolbar, and then click the location in the document where you want to place the field.
-
Resize the text field by dragging any of its corners.
-
Double-click the field to open the Properties window.
-
In the Options tab,
- To create a multi-line field, select Multi-Line. By default, the number of lines in the field is equal to the size of the text field.
- To allow multiple lines without any limit, select Scroll Long Text. If the entered text exceeds the field size, Acrobat provides a scroll bar to scroll through the text.
-
Click Close.
Add basic calculations to PDF form fields
Acrobat provides three options for creating field calculations.
1: Predefined calculations
The calculations like sum, product, average, minimum and maximum can be added using the predefined calculation. The below example shows how to use predefined calculations for two fields.
-
In the Prepare Form toolbar, select and add three text fields – Text1, Text2, and Text3. Text3 will be the calculated field.
-
Double-click the Text1 field to open its Properties. In the Format tab, Select Format Category as Number. Repeat this step for the remaining two text fields.
Note:By default, the text fields are named as Text1, Text2, and so on. To change the name of the field, go to the General tab and enter the Name as Num1 or any other name you want, and click Close.
-
Double-click the Text3 field to open its Properties. In the Calculate tab, choose Value Is The, and in the drop-down list choose one of the following
- To add Text1 and Text2, select Sum(+).
- To multiply Text1 and Text2, select Product(x).
- To calculate the average of Text1 and Text2, select Average.
- To get the minimum of the numbers entered, select Minimum.
- To get the maximum of the numbers entered, select Maximum.
-
Click Pick. In the Field Selection dialog, select Text1 and Text2, and click OK.
-
Click Close. When you enter numbers in Text1 and Text2 fields, Text3 displays the calculated value as per the chosen type of calculation in step3.
Note:The predefined calculations are rather limited, for example, there is no division or subtraction.
2: Simplified field notation
The simplified field notation allows the creation of much more complex calculations. It uses a notation similar to how a calculation would normally be written, that is, using the regular math symbols, + (addition), - (subtraction), * (multiplication) and / (division). Field names are used as operands. To use the simplified field notation, do the following:
-
In the Prepare Form toolbar, select and add three text fields – Text1, Text2, and Text3. Text3 will be the calculated field.
-
Double-click the Text1 field to open its Properties. In the Format tab, Select Format Category as Number. Repeat this step for the remaining two text fields.
Note:By default, the text fields are named as Text1, Text2, and so on. To change the name of the field, go to the General tab and enter the Name as Num1 or any other name you want, and click Close.
-
Double-click the Text3 field to open its Properties. In the Calculate tab, choose Simplified Field Notation, and click Edit.
-
In the JavaScript editor, enter the code to calculate. For example, to calculate the product of the sum of two numbers and subtraction of two numbers, type (Text1+Text2)*(Text1-Text2) and click OK.
-
Click Close.
3: Custom JavaScript™ calculations
Use custom JavaScript™ to create more complex math calculations. This option requires entering JavaScript™ and gives full access to all the fields in the PDF file, and the rich math features in the JavaScript™ language. It also requires use of the full Acrobat JavaScript™ syntax that makes the calculations longer. For example, the following code solves the same equation used in the simplified field notation example above.
-
In the Prepare Form toolbar, select, and add three text fields – Text1, Text2, and Text3. Text3 will be the calculated field.
-
Double-click the Text1 field to open its Properties. In the Format tab, Select Format Category as Number. Repeat this step for the remaining two text fields.
Note:By default, the text fields are named as Text1, Text2, and so on. To change the name of the field, go to the General tab and enter the Name as Num1 or any other name you want, and click Close.
-
Double-click the Text3 field to open its Properties. In the Calculate tab, choose Custom Calculation Script, and then click Edit.
-
In the JavaScript™ editor, enter your code for calculation. For example, to calculate the product of the sum of two numbers and subtraction of two numbers, type
event.value=((this.getField("Text1").value+this.getField("Text2").value))*((this.getField("Text1").value-this.getField("Text2").value)); -
Click OK and then click Close.