Hello,

I searched the mailing lists archives but didn't find anything related to this problem.

I noticed the following behaviour when validating a field:
When the form field is empty or contains only whitespace, it isn't validated.


Basically what happens is that when the field has only whitespace the validator considers it as empty and doesn't run it through the validation routines. I'm using the "mask" validator here.

This causes problems:

I have some fields that are optional. But if they are not empty, they should conform to certain REGEXP patterns. Now, if the field has only whitespace in it, it isn't rejected by the validator and the action receives a String that is neither empty nor conforms to the REGEXP.

My workaround: In all fields where this happens I call String.trim() first, to get rid of the whitespace and then check if the String is empty.

Is this a bug?

Thanks for any feedback,

Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to