75 pts.
 Change dynamic date/time in Adobe form to static
I have an Adobe form that automatically populates the date and time of a request and then is emailed (fdf) for fulfillment. When the recipient opens the form, the time changes to the current time. The code that I am using is: this.getField("RequestDate").value = util.printd("m/d/yyyy HH:MM", new Date()); and it is in the custom calculation script on the Calculate tab. The ideal situation would be that all data sent becomes write protected once it is submitted, but I need the date/time to become static once they hit the submit button. Would I have better luck using the Actions tab? If so, how? Any suggestions for improving this situation will be greatly appreciated.

Software/Hardware used:
ASKED: July 11, 2008  2:30 PM
UPDATED: July 22, 2008  1:54 PM

Answer Wiki:
You could change the scripting event from the form/doc open to the form submit/submit button click event. Then the ability to change the value is limited to whether the user can interact with the button. Alternatively, you can set a persistent global value containing a boolean that indicates that the form was once submitted. (You probably have this: <a href="http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf">http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf</a>) Under global > global methods > setPersistent.
Last Wiki Answer Submitted:  July 21, 2008  8:00 pm  by  Czarp   300 pts.
All Answer Wiki Contributors:  Czarp   300 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I didn’t have the Javascripting reference so thanks for that.

I like the idea of of submitting being what triggers the date and time. The added benefit is that if it sits on a user’s desk for a while before submission, the time will be a more accurate reflection. I will see if I can make that work.

Thanks.

 75 pts.