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

How lock/freeze Current Date field? (Designer 8.0)

chornung
Registered: May 22 2008
Posts: 4

Developed form where current date is [b]Calculated-Read Only[/b] using FormCalc script [color=#FF0000]$.rawValue = num2date(date(), DateFmt(4))[/color]

User completes form in Reader 8 and saves. When Manager opens saved form two days later, that later date is displayed. Same thing happens when using [b]Custom - Current Date[/b] field from Library.

How do I freeze/lock original date of form completion? There is no need for digital signature, unless that is absolutely the only way to accomplish this.

My Product Information:
LiveCycle Designer, Windows
JohnnyRiv
Registered: Dec 2 2008
Posts: 9
Chornung, I use the following in the layout:ready event

if($.rawValue > "") then $.rawValue
else $.rawValue = Num2Date(Date(), DateFmt(4))
endif

Hope you find it helpful.

Johnny

Acrobat 5, 6 Pro, 7 Pro, 8 Pro, 9 Pro Extended, LC 7, 8 & LC ES 8.2

Morabe
Registered: Nov 21 2006
Posts: 20
Apologies for re-opening this thread! I tried JohnnyRiv's FormCalc script in the layout:ready event but cannot get it to work in LD ES. When I save the dynamic XML PDF with the current date (e.g. 2009-04-16), and re-open it the following day, the date still changes to the new current date (2009-04-17).

Am I missing another option(s) that needs to be turned on/off somewhere?
JohnnyRiv
Registered: Dec 2 2008
Posts: 9
Morabe, I'm not aware of any missing option except for possibly having JavaScript disabled in Edit > Preferences > Javascript > Enable Acrobat JavaScript.JohnnyRiv

Acrobat 5, 6 Pro, 7 Pro, 8 Pro, 9 Pro Extended, LC 7, 8 & LC ES 8.2

atvland
Registered: Jul 8 2010
Posts: 3
I've managed to use this piece of script to lock date and time fields, and it's all working as expected - but the fields are locked to the date/time I opened the PDF before extending it for use in Acrobat Reader.

My form will be used by telesales staff to take sales enquiries, capturing the date and time the enquiry was taken. The vast majority of these staff use Acrobat Reader. I therefore need to make a read-only PDF where the date/time field is blank and automatically filled in on the first occasion the master is opened - and then locked in subsequent copies.

However I can't do this, as I before I distribute the form I need to extend it in Reader, which means that the date and time are set to the date/time I opened it in order to extend features! It's driving me mad! Can anyone help?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
[color=#333333]Hi, [/color]
[color=#333333][/color]
[color=#333333]try the following steps.[/color]
[color=#333333][/color]
[color=#333333]1. Open form in Acrobat[/color]
[color=#333333]2. Clear the date field, it will stay blank if you used the script above[/color]
[color=#333333]3. Enable Usage Rights[/color]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

atvland
Registered: Jul 8 2010
Posts: 3
Thanks for your quick reply Radzmar, I'm most grateful for your help because trying to design this form is causing my brain to ache - I keep waking up in the middle of the night, and having mad dreams about PDF forms!

I tried changing it so that I could clear the date as you suggested, but it just replaces the blank field with the current time and date automatically as soon as I move the focus to another field. In any event, I need to keep this field read-only. If I change it so that a user can override it, it defeats the object of the exercise!
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Well,

use this script in the form:ready event of your date field:

if ($.rawValue == null) then$.rawValue = Num2Date(Date(), DateFmt(4))else$.rawValueendif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

atvland
Registered: Jul 8 2010
Posts: 3
It works! Thanks radzmar, you've saved my life!