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

Java timestamp

JRowe
Registered: Oct 31 2011
Posts: 3

I'm attempting to create a variation of the new Date variable in javascript for Livecycle that will allow me to create a current timestamp in HH:MM A on the click event of a button. I'd also like to bind this globally to multiple date/time fields that will then display the time respective buttons are clicked. I have completed this successfully using FormCalc "rawValue = Num2Time(Time(), TimeFmt(1))" but have most troubling come to find that FormCalc events are inoperable on the iPad (using PDF Expert) that users will utilize to complete the form. Javascript, I have learned, should work just fine. I am, however, unfamiliar with the scripting language.
 
I have been working on this for quite some time and would appreciate any assistance you're able to lend.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
For a LiveCycle Form:

On Button Click Event

TextFieldName.rawValue = util.printd("HH:MM",new Date());


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

JRowe
Registered: Oct 31 2011
Posts: 3
@ thomp

Thank you SO much for your reply. This works brilliantly, however only on a desktop, again not on the iPad. I have made sure Java is enabled on the device, as are both the button and the Date/Time Field I'm using for all events.

The particularly confusing thing for me is that, using FormCalc, the iPad successfully computes:

$.rawValue = Concat(Num2Time(Time(), "HH:MM:SS"))

for a date/time field on an initialize command. It will not, though, allow this (or your kindly offered Java function) to be used on a click event for a button and fill a Date/Time Field in the form.

I am certain at least some Java functions work on the iPad, since I took a look at the XML source for the pre-programmed print button available in LiveCycle and it functions flawlessly is Java. Its code looks like this:

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);Perhaps there is something I can manipulate using the "xfa.host" portion of the print script to properly tell the iPad to retrieve the time?

Any assistance you're able to offer is again appreciated.

Sincerely,

Banging his head against a wall
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Apple has seen fit not to have JavaScript on the iXxx devices. You might find an app that can process PDF forms with JavaScript.

Apple OS also causes problems with its preview application and returning a completed PDF form that is viewable. It is fixable but the problem is cleary an Apple OS problem.

George Kaiser