Excuse me.
Great idea and nice small hack.
Actually, with che code you suggested, such a check for one field would be performed
each custom field for the same X number (it's within the while clause).
I think should be better to replace the above code with something like :
PHP Code:
//HACK: Numeric Required Field in User Profile
if ($profilefield[profilefieldid]==X) { // number of field you're checking
if (is_numeric($$varname)) {
$log_field=round((float)$$varname);
} else {
$log_field=0;
}
if ($log_field < 1920 OR $log_field > 1990 ) {
eval("standarderror(\"".gettemplate("error_numericfieldonly")."\");");
exit;
}
$$varname=(string)$log_field;
}
//HACK: Numeric Required Field in User Profile
The problem rises mostly when you have required fields. If the above field it isn't numeric, the above exception comes before the required field one. This way I realized such a mis-function....
Thanks again and sorry the intrusion.
But I did this way and would share such a small work-around.
Bye