1 Reply Latest reply on Dec 7, 2017 5:56 AM by try67

    Auto Fill a Date Text Field... but only once.

    jcbarker74 Level 1

      Under Page Properties, I am using a script for an action upon opening the document in order to automatically populate the current date.

      Generally, once a user completes the form for the day, they will Save As that date. December 7, 2017 is usually saved as 120717.


      The script works as it should. The problem is when you open the saved form to revew it, the date changes to the day you're opening.


      How can I modify the following script or action to only populate the date once and never allow it to change?


      Under page properties, action tab, I selected page open as the trigger for the following script...


      var f = this.getField("Date");

      f.value = util.printd("mmm/d/yyyy", new Date());