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 7 of 7
  1. #1
    dmk
    dmk is offline
    New Coder
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Today's Date in Acrobat form

    I have a date field in an Acrobat (v 5.0.1) form and I want it to be preloaded with the current date when the user opens the form. I have to work within Acrobat's code box and I used the following (provided in their documentation) but it didn't work:
    The script name is Today
    Code:
    var f = this.getField("Today");
    f.value = util.printd("mm/dd/yyyy", new Date());
    The message I get is
    TypeError: f has no properties
    . Can you help? Thanks.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    If "f has no properties" then presumably it's not a Field object. How did you create it?

    By "The script name is Today" ....did you mean the field's name?

  • #3
    dmk
    dmk is offline
    New Coder
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In the Acrobat Help, in their JavaScript section, they provide code to fill a form field with the current date. I cut and pasted it directly.

    And Today is the name of the script. Acrobat asks you to fill in a name and it calls that the name of the "script."

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Posts
    1,404
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Would need to see the entire (generated) page.

  • #5
    dmk
    dmk is offline
    New Coder
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That's not possible. Thanks anyway.

  • #6

  • #7
    dmk
    dmk is offline
    New Coder
    Join Date
    Aug 2002
    Location
    Wisconsin, USA
    Posts
    54
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thank you so much! It worked perfectly. I'm not sure why I came here instead of visiting Adobe's site -- maybe it's the personal touch we give and get! Thanks.

    Diane


  •  

    Posting Permissions

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