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

Add Days to Date/Time Field

EJR
Registered: Aug 27 2007
Posts: 23
Answered

I have a form with two date fields. One is the Date Submitted and the other is the Date Required field.
The first thing I would like is that the Date Submitted field will autofill when they push the Submit button.
The second thing is I would like is that the earliest date they could pick in the Date Required field would be the submit date + three workdays. For example, if they submitted their form on 02/02/2009 the first choice they would have in the Date Required field would be 02/05/2009.

Thanks in advance for any help.

EJR

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Well, you can calculate the requiered date in a way like this:
It's FormCalc. Put it into the calculation event of DateRequiered.

if (Form1.Page1.DateSubmit.rawValue==null)then
$.rawValue = ""
else
Num2Date(Date2Num(Form1.Page1.DateSubmit.formattedValue, "MM.DD.YYYY") + 3, "MM.DD.YYYY"))
endit

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

EJR
Registered: Aug 27 2007
Posts: 23
Thanks Radzmar. On the same topic how do I alter the script for weekdays. For example, if form is submitted on a Friday I want to earliest required date to be the following Wednesday. Is there any specific reference manuals you would recommend for learning these types of things?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
FormCalc documentations

http://help.adobe.com/en_US/livecycle/8.2/FormCalc.pdf

partners.adobe.com/public/developer/en/xml/formcalc_2.0.pdf

and of course pressing F1 :-)

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs