24 Replies Latest reply on Nov 7, 2017 1:33 PM by dawnborendesign

    how do i populate a form with current date?

    rosemariem24343617

      I tried the instructions below but it does not work:

       

      In Acrobat:

      The script you create to display the current date when the document is opened is a document level script.

      To create an automatic date field:1. Select Tools > Forms >. Edit > Add New Field > Text Field and create a text field. (For more infor-mation, see the section on Creating Form Fields in the Acrobat online help.) Select All Properties > General tab and name the field Today.

      2. Select the Format tab, chooses Date for the format category, and chooses a month, day, and year format option (for example, “mmm d, yyyy”). On the General tab, make sure the field is read-only because it will be a calculated field, and click Close.

      3. To create a document level script that is executed each time the document is opened, choose View > Tools > Document Processing > JavaScript > Document JavaScripts. Name the script Today, and click Add.

      4. Delete the automatically generated text, defining a Today function, that is displayed in the script window. Type in the following text in the exact format (line wraps are OK) and click OK.

      var f = this.getField("Today");f.value = util.printd("mm/dd/yyyy", new Date());

       

      This script binds the Today field to the variable f, and then calculates the value. The newDate() ex-pression creates a new date object initialized to the current date and time. The util object is used to format the date into the month/day/year format.

      5. Click OK in the JavaScript Edit dialog box, and then click Close in the JavaScript Functions dialog box.