Hi there,
I have a straight forward form in that requires the user to enter a date in one box and then a script automatically fills in a second box with an new date 10 day further on.
The script I'm using is
var strStart = this.getField("DateStart1").value;
if(strStart.length)
{
var dateStart = util.scand("d-mmm-yyyy",strStart);
var oneDay = 24 * 60 * 60 * 1000;
var dueMillis = dateStart.getTime() + 5 * oneDay;
var dueDate = new Date(dueMillis);
event.value = util.printd("d-mmm-yyyy",dueDate);
}
else
event.value = "NA";
the problem i have is that when the user fills in any of the other boxes on the form prior to the date (which given the flow of the layout is a sensible the natural thing to do) the get the following warning.
Now the two form fields involvedd in the script have their format to d-mmm-yyy, so any ideas (other than having the user always fill in the date box first) as to how I prevent this box from showing up.
thanks in advance for any help.
"NA" is not a valid date. You should set your field to have no formatting.
Then you should not receive this error.