Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    populate an Acrobat field with a date only once?

    Hello everyone, I have a small script which runs when the acrobat document opens and populates a field with the date, but I would like the date to be filled when the document is first opened, then saved with that date. Could someone help with this script?

    code:
    // get new Date object
    var d = new Date();

    // format to mm/dd/yyyy
    var sDate = util.printd("dd/mm/yyyy", d);

    // insert date into form field
    this.getField("todaysDate").value = sDate;

    Thanks

    lister

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,733
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Wrap it in a function and call it with

    <body onload = "functionName()" ....


    It is your responsibility to die() if necessary… - PHP Manual


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •