?
Solved

Today's Date Default Field in Acrobat X

Posted on 2011-03-03
2
Medium Priority
?
3,175 Views
Last Modified: 2012-05-11
Hi there.
Several years ago, I created a PDF document that had a date field that defaulted to today's date when it was opened. It used some JavaScript to make that happen. I've since upgraded to Adobe Acrobat X and need to do this for another form, but can't remember how I did it. I've tried several online resources and have come up empty. It seems everything I've found is for a different version of Acrobat and doesn't apply. Here's what I've tried so far:

http://www.ehow.com/how_2316630_insert-date-field-adobe-acrobat.html
The problem I'm running into is that the Trigger event listed in this article isn't consistent with what's available in this version of Acrobat. I was looking for a "Page Open" event to tie the JavaScript code to, but I only have these options:

Mouse Up, Mouse Down, Mouse Enter, Mouse Exit, On Focus, On Blur

Right now, the Java script code is applied in the Actions tab of the Text Field Properties, but I can't get this to work. Any suggestions? Am I missing something? Here's the code used to generate today's date:

var f = this.getField("wells_datefield");
if (!f.value) f.value = util.printd ("m/d/yyyy", new Date());

Thanks for your help.

J
0
Comment
Question by:brownmetals
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 2000 total points
ID: 35036877
You can use a calulated value for that field. Bring up the field properties and select the "Calculate" tab, then select to use a custom calculation script and use the following line:

event.value = util.printd("m/d/yyyy", new Date());

That should do the trick.
0
 
LVL 4

Author Closing Comment

by:brownmetals
ID: 35060084
Awesome. Thanks for your help.
J
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe INTRODUCTION This Article is a follow-up to the Article entitled How To Rename-Move a Batch of PDF Files Based o…
*Adobe Acrobat 9 was used for this article. Particular steps may vary depending on software versions. 1. Create a framework of your form in Word, leaving space where you’d ultimately like the Adobe fields to appear.  (Note: I use the blank lines …
In this second video of the Xpdf series, we discuss and demonstrate the PDFimages utility, which, in a single command, is able to extract all the images from a PDF file and save each one in a separate image file (PBM, PPM, or JPG). Download and inst…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question