Hi Ben,
Thanks for the advice! Managed to get it to work using Submission Pre-parser module .
Both my DOB (DD/MM/YYYY) and Age field are in textfield format. My code is as below, for those interested.
A preferred approach will be not to modify the database but just create a view that derives the age from the DOB column in database. Feature suggestion: A module to perform a "Display pre-parser" to display any derived info from the database will be very useful.
Thanks again & Best Regards,
Mun Hin
Thanks for the advice! Managed to get it to work using Submission Pre-parser module .
Both my DOB (DD/MM/YYYY) and Age field are in textfield format. My code is as below, for those interested.
PHP Code:
if ( (isset($_POST["dob"]) && !empty($_POST["dob"])) )
{
$dob = floor((time() - strtotime($_POST["dob"]))/ 31556926);
$_POST["Age"] = "{$dob}";
}
A preferred approach will be not to modify the database but just create a view that derives the age from the DOB column in database. Feature suggestion: A module to perform a "Display pre-parser" to display any derived info from the database will be very useful.
Thanks again & Best Regards,
Mun Hin