Solved

Today's Date Default Field in Acrobat X

Posted on 2011-03-03
2
2,848 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
2 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
Comment Utility
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
Comment Utility
Awesome. Thanks for your help.
J
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
pdf frustration 2 128
Barcode detail gets lost in PDF 3 83
Adobe PDF link to folder 5 47
Adobe Acrobat Pro: Is this a known bug? 9 55
One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now