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

Date stamping a form upon clicking the Submit button

mkenny
Registered: Sep 22 2011
Posts: 5
Answered

I have a form that upon clicking the EmailSubmit button, I would like a text box to populate with the current date, or what I am calling the "EffectiveDate". I would like it to populate with just the date, no time. I am using Livecycle ES 8. I found Javascript code to do this, however, it does not work in Livecycle, only in Acrobat (this.getField). Can someone advise of the Javascript code that would work with Livecycle?
 
I found the following code, which works, but I only want the date; this gives the day and time along with the date.
Code: topmostSubform.Page1.EffectiveDate.rawValue = Date();
Result: Tue Sep 27 2011 09:53:19 GMT-0700 (US Mountain Standard Time)
 
Lastly, I also have code written to this EmailSubmit button which locks all the fillable fields before sending. I am not having any problems with this code.
 
Thanks,
MJ

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Accepted Answer
Use the Mouse Down event on the submit button.

EffectiveDate.rawValue = util.printd("mm/dd/yyyy",new Date());

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

mkenny
Registered: Sep 22 2011
Posts: 5
Thanks, Thom. That worked!