Javascript Calculations on Spawned Pages from Template
I have a form that has 5 pages that allows the addition of pages from templates. None of the calculations or auto tabs work. I'm very new to javascript and have searched many forums without success. Here is what my age script looks like, what do I need to add so when it spawns from the template it works properly. Thanks in advance for help.
var dob = util.scand("mm/dd/yyyy", this.getField("P3.AttachmentA.VIC2DOB").valueAsString);
if (dob != null) {
var today = new Date();
var age = today.getFullYear() - dob.getFullYear();
var m = today.getMonth() - dob.getMonth();
if (m < 0 || (m === 0 && today.getDate() < dob.getDate())) {
age--;
}
event.value = age;
}
else {
event.value = "";
}
