I have read post after post after post and can still not get an AGE to calculate when a date is placed in a field. I am EXTREMELY new to this and feel defeated already. I know there are a lot of posts about this, but I am still not grasping it.
I need the age to go into a field titled "AGE" that is calculated from a date of birth field titled "DOB"
I have the current date being automatically filled in when the PDF opens in a field titled "DOS3"
I need some help! I am just a fireman, this is FAR above my pay grade! I am using Adobe Professional 9 (I think).
var fSec = 1000;
var fMin = 60 * fSec;
var fHr = 60 * fMin;
var fDay = 24 * fHr;
var fYear = 365.25 * fDay;
var strStart = this.getField("AGE").value;
var strToday = util.printd("mm/dd/yyyy", new Date());
var strToday = this.getField("DOB").value;
if(strStart.length & strToday.length) {
var DOB = util.scand("mm/dd/yyyy", strStart);
var Today = util.scand("mm/dd/yyyy", strToday);
var diff = Today.valueOf() - DOB.valueOf();
diff = diff + fDay;
event.value = Math.floor(diff/ fYear);
}