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

Date field autopopulates, can i made it editable?

scderacjor
Registered: Mar 27 2009
Posts: 123
Answered

Here is the code I am in FormCalc, using for my date field to autopopulate with today's date.

$.rawValue = Concat(Num2Date(Date(), "YYYY-MM-DD"))

However, if someone is using this form today but sending it tomorrow, I want them to be able to change the date. Then if they happen to open it two days later, I want it to keep the date they entered, but still be able to change if they choose to change it.

The excuse I got was sometimes people forget what today's date is. Even though the box would have a drop down with today's date SELECTED, they would still like it autopopulated.

My Product Information:
LiveCycle Designer, Windows
--SID--
Registered: May 4 2010
Posts: 31
you can use your script at the initialize event of the form or the field, so that when the form loads up, the date is already there.

and then if someone wants to edit it after opening the form, they can do that as well.

~~ S I D ~~

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can wrap your script with an if-eles expression, such as:

if ($.rawValue == null) then$.rawValue = Concat(Num2Date(Date(), "YYYY-MM-DD"))else$.rawValueendif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

scderacjor
Registered: Mar 27 2009
Posts: 123
I meant "can I make it editable"* :)

And thank you radzmar, as always! It's very nice and helpful of you to add in the script when giving your answer. I placed the code in the layout:ready section and it works perfectly.
Thank you!