I had created forms for my work that allowed me to calculate back dates from a given date to instruct the form users when components of a project were due. Below is the script I used- I am NOT a programmer and this was taken from another forum. It has worked successfully for 2 years in both Acrobat 9 & 10 and in various forms I have made.
var strStart = this.getField("0VendorArtApproved-2wk").value;
if(strStart.length)
{
var dateStart = util.scand("mmm d, yyyy",strStart);
var oneDay = 24 * 60 * 60 * 1000;
var dueMillis = dateStart.getTime() - 21 * oneDay;
var dueDate = new Date(dueMillis);
event.value = util.printd("mmm d, yyyy",dueDate);
}
else
event.value = "NA";
"0VendorArtApproved-2wk" is the field the previous date was taken from- this and the amount of days "- 21" changes from field to field. This form has 3 levels that it calulates dates from- which starts with a single initial date entered into a text box by the user. This allowed the user to see when different elements of a project were due. Sorry if this seems basic to all the Javascript masters but I am really very clueless on prgramming speak and only know what I have read from forums.
The last version of the form that worked successfully was in Oct 13', I went to create a new form and copied these formula boxes to a new form and now half of them do no work.
I have rechecked my formulas and formatting and cannot find and issue. They are exactly the same. One works and one does not. The only thing I can see different from the 2 forms is that I am certain there were 1 or 2 updates to the Acrobat software itself that could possibly have caused an issue.
So I have 2 documents- 1 created in October 13' that works and one created today Jan 14' that does not work. They have the same formulas.
Anyone aware of changes to Acrobat or errors in my formula that could have caused this? I am in version 10.1.9