Skip navigation
Neil-Kentucky
Currently Being Moderated

Autofill Today's date as "d day of mmmm, yyyy"

Jul 25, 2012 9:56 AM

Tags: #acrobat #x #pro #field #date

I have a purchase contract I need to have auto-fill in the date. 

 

The line reads, "Made this ____ Day of ______, _______.

Filled-out it would read, ""Made this __3__Day of July__, 2012.

 

I currently have my form fill in other date fields formatted as mm/dd/yyyy using this script and wondered if someone might know how to modify the script to change the format?

 

 

function DateToday() {
this.getField("DateToday").value = util.printd("mm/dd/yyyy", new Date())
 
return true;
} // end of DateToday() function
 
 
Replies
  • Currently Being Moderated
    Jul 25, 2012 10:17 AM   in reply to Neil-Kentucky

    Are they separate fields, or a single field?

     

    Try this in the Calculation script for the field if you are using a single field (Otherwise, separate each value and use that for each individual field):

     

    var d = new Date()

    event.value = "Made this " + util.printd("d", d) + " Day of " + util.printd("mmmm", d) + ", "  + util.printd("yyyy", d) + "."

    Edit: If you need to use a separate function so the value doesn't change, you can alter your function

     

    function DateToday() {
    this.getField("DateToday").value = "Made this " + util.printd("d", d) + " Day of " + util.printd("mmmm", d) + ", "  + util.printd("yyyy", d) + "."
    return true;
    } // end of DateToday() function

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points