I've got a field wich uses the Custom PHP function for validating the input. But the input isn't required (the required checkbox isn't checked). But the validation isn't skipped, so when the field is left empty, the error message from the validation presents itself.

Mike.

Comments

g089h515r806’s picture

You could skip it in your Custom PHP function.
Just return TRUE if $variables['value'] is empty.

sportel’s picture

Thanks,

I'll try that. But nevertheless, isn't it a bug in the module? Shouldn't the validation be skipped when the required checkbox isn't checked and the field is left empty?

Mike.

g089h515r806’s picture

There are some situation that "required checkbox isn't checked and the field is left empty", but the field is unvalid.
I think there are some case.For eaxample, several fields , at least one of them is not empty.
at this case, although it is not required, and it is empty, but we still could not sure whether it is valid.

henryblyth’s picture

I agree with g089h515r806; this isn't a bug. "Required/not required" and "Empty/not empty" are not mutually exclusive.

g089h515r806’s picture

Status: Active » Closed (works as designed)