I tried to modify some other script I found, but I really don't understand it well enough to make it work. I am using Adobe Acrobat XI Pro.
I am calculating the expiration date of an extended warranty. All dates are entered with the MM DD and YYYY in separate fields, due to the Manufacturer's form.
First Date is manually entered, date of original purchase.
2nd date is already set up to autofill current date.
3rd date is where I need help. I have the MM and the DD as duplicate fields from the first date, this is working fine. I need the "Year_3" field to automatically add 4 years to the YYYY from from the first date's "Year" field.
Any help is appreciated.
If the first field is called Year1, use this custom calculation code for the second field:
var year1 = this.getField("Year1").valueAsString;
if (year1=="") event.value = "";
else event.value = Number(year1)+4;