felepeg
New Member
Hi to all
i'm using calc pluggin to calculate age from date of birth using the next php code:
$date= '{dbpac1___Fecha_Nacimiento}';
$date = strtotime($date);
$now = time();
$diff = $now - $date;
$years = floor($diff / 31556926);
return $years;
which is working fine except in two cases:
1.- when open the form at start appears the number 43 in the calc field and that number is recorded in the database.
2.- when i click reset in the form, the ajax form doesn't works and keeps the last calculation done from the pluggin
thanks!
i'm using calc pluggin to calculate age from date of birth using the next php code:
$date= '{dbpac1___Fecha_Nacimiento}';
$date = strtotime($date);
$now = time();
$diff = $now - $date;
$years = floor($diff / 31556926);
return $years;
which is working fine except in two cases:
1.- when open the form at start appears the number 43 in the calc field and that number is recorded in the database.
2.- when i click reset in the form, the ajax form doesn't works and keeps the last calculation done from the pluggin
thanks!