Good Morning,
I would like to have the field "appAge" be auto-calculated based on the date given in "appDOB" which has a mask of mm/dd/yyyy. I could use some help getting it to format
You can preview the form located at http://mwforms.miworksmo.org/wiareg.
I would like to know the best course of action to take with this, as I have been able to calculate the appropriate age with a simple PHP page, which the code looks like this for:
Because I am still learning this on the fly, I could use some help and recommendations...
Thank You.
I would like to have the field "appAge" be auto-calculated based on the date given in "appDOB" which has a mask of mm/dd/yyyy. I could use some help getting it to format
You can preview the form located at http://mwforms.miworksmo.org/wiareg.
I would like to know the best course of action to take with this, as I have been able to calculate the appropriate age with a simple PHP page, which the code looks like this for:
<?php
/**
* Simple PHP age Calculator
*
* Calculate and returns age based on the date provided by the user.
* @param date of birth('Format:mm-dd-yyyy').
* @return age based on date of birth
*/
function ageCalculator($dob){
if(!empty($dob)){
$birthdate = new DateTime($dob);
$today = new DateTime('today');
$age = $birthdate->diff($today)->y;
return $age;
}else{
return 0;
}
}
$dob = '1975-12-22';
echo ageCalculator($dob);
?>
Because I am still learning this on the fly, I could use some help and recommendations...
Thank You.