Professional Documents
Culture Documents
You may want to know the date that a user completes a form. You can insert a text field in your
PDF form that will automatically insert the current date. This field uses a simple JavaScript at the
page level. Adding an automatic date field is a two-step process: First you must add the Date
field. Then, you must add the JavaScript to the Page Properties.
1. Open the PDF file that you will use the form for.
4. Position the cursor where you want the text field to begin.
5. Click and drag the mouse until the text field reaches the desired size.
9. On the General tab, in the Common Properties section, select Read Only.
NOTES:
An option is selected when a check appears in the box next to it.
This is necessary for calculated fields such as a date.
b. From the Date Options scroll box, select a date format option.
NOTE: This representation of the date format will be used when adding the JavaScript.
An example of the date format is shown below the list.
NOTES:
The Pages pane opens.
This action toggles between hiding and displaying the Pages pane.
3. Right click the page thumbnail of your form that contains the Date field » select Page
Properties...
The Page Properties dialog box appears.
5. In the Add an Action section, from the Select Trigger pull-down list, select Page Open.
7. Click Add...
The JavaScript Editor dialog box appears.
8. Type the text shown here:
var f = this.getField("Today");
f.value = util.printd("mmm/d/yyyy", new Date());
NOTES:
Improper spacing in the text may affect results.
The field reference must match the name you assigned to the text box in step 7 of Inserting
the Date Field.
The date format must match the format you selected in step 10 of Inserting the Date Field.
9. Click OK.
13. In the File name text box, type the file name.