On Jan 29, 2007, at 10:42 AM, John Martin wrote:
On more careful examination of the isEmail function, the first test is to see if the string is empty and if so it returns true. I can't imagine why that condition should return true, null or an empty string do not constitute an email address. My only thought for a reason would be if the field beingtested is an optional field. In that case it shouldn't be the responsibility of the function but the form handler.The function should return an absolute true/false that the string is anemail and not. Comments?
You'll find this pattern throughout and it is VERY intentional. Only the not empty constraint requires a non-empty string, and that's the way it's supposed to be, otherwise you get weird and very confusing error messages.
Committers please read: don't ever change this, it is VERY intentional! -David
smime.p7s
Description: S/MIME cryptographic signature
