Need a little FormCalc OR JavaScript Help from the Community.
Have a form that has three fields ... Date Of Birth, Age, and Emancipation Date.
User Selects DOB, then I calculate Age: (Works Fine)
if(DOB.rawValue ne null) then
Floor(((Date2Num(DOB.formattedValue, "MM/DD/YYYY") - Date() )/365.25)*-1)
endif
The Emancipation Date Field is the one I need some help with.
I need to Have that field Calculate the Date the person turns 18 if Age < 18
I think the easiest way is just to add "18" to the YYYY part instead of calculating it due to leap years and such.
Any Suggestions would be very helpful.