Solved

Today's Date Default Field in Acrobat X

Posted on 2011-03-03
2
3,107 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 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Getting information about Fonts being used in a PDF file A colleague of mine recently faced an issue related to the PDF file format. The PDFs were containing mission critical client information, they were successfully mailed but there was a sm…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

717 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