Closed (works as designed)
Project:
Field Validation
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Mar 2012 at 11:13 UTC
Updated:
3 Aug 2012 at 10:56 UTC
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
Comment #1
g089h515r806 commentedYou could skip it in your Custom PHP function.
Just return TRUE if $variables['value'] is empty.
Comment #2
sportel commentedThanks,
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.
Comment #3
g089h515r806 commentedThere 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.
Comment #4
henryblyth commentedI agree with g089h515r806; this isn't a bug. "Required/not required" and "Empty/not empty" are not mutually exclusive.
Comment #5
g089h515r806 commented