10-05-2007, 08:53 AM
[eluser]coolfactor[/eluser]
The fix is simply to remove the check for a callback function. Here's the same code as above, but with the callback removed:
Callbacks are then treated the same as other functions. If the field is optional, they are only called if the field exists in $_POST and has a non-empty value.
The fix is simply to remove the check for a callback function. Here's the same code as above, but with the callback removed:
Code:
// Is the field required? If not, if the field is blank we'll move on to the next test
if ( ! in_array('required', $ex, TRUE))
{
if ( ! isset($_POST[$field]) OR $_POST[$field] == '')
{
continue;
}
}
Callbacks are then treated the same as other functions. If the field is optional, they are only called if the field exists in $_POST and has a non-empty value.