These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Consecutive Dates

ajacobs
Registered: Jun 3 2007
Posts: 4

I would like to make a PDf log sheet using livecycle designer. What type of function would I use to be able to enter a date in a date field and then have the form automatically fill in the consecutive dates on the rest of the form.

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Dates in LiveCycle are handled the same way dates are handled in AcroForms. This is because dates are part of Core JavaScript, not any particular DOM.

The LiveCycle DateTime field sets and returns dates in JavaScript as a string. So your code has to grab this string. Parse it into a real date object. Calculate out the set of consecutive dates. Then reformat these dates into the correct format and apply them to the consecutive date fields.

Here's an article on dates in JavaScript.
[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/[/url]

There are 3 parts. The examples are in AcroForm JavaScript but 90% still applies to what you want to do.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script