-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi everyone,
I haven't been able to fully understand how the custom constraints in textboxs work, in a past thread a fellow forum member explained to me how to validate an email you should put:
constraint="/.+@.+\.+|/: Please enter a valid email"
String s = textbox.getValue(); if(s.constains(">") || s.contains("<")){ }
Sorry for the typos....
and BTW, the constraint of the textbox is actually:
constraint="/.+@.+\.a-z+|/: Please enter.....
There's a part missing....maybe it's because you're not supposed to use ] or [
They're supposed to be before the a and after the z.
Sorry..
the constraint in textboxs that you mentioned, it follows the 'regular expression'.(I think just call the JAVA/JavaScript regular expression api to handle it.
if you want to write more custom constraint which isn't regular-able, you can write custom constraint.
http://docs.zkoss.org/wiki/Form_and_Inputs#Custom_Constraints
Asked: 2009-01-24 22:26:23 +0800
Seen: 826 times
Last updated: Feb 02 '09