[validation] Help with 'contains' validation

2005-03-01 Thread Wendy Smoak
(No luck on commons-user; trying again here.) I'm trying to validate a password such that it cannot contain the userId. Is this something I can do in validation.xml? I'm currently using a mask in validation.xml: field property=password depends=required,mask arg0 key=label.password/

Re: [validation] Help with 'contains' validation

2005-03-01 Thread Erik Weber
This is untested (!), but adapted from a working twofields validation method (used to make sure password1 matches password2, etc.), so it shouldn't be far off the mark. validation.xml: !-- nothing real unusual here -- field property=userID depends=required,minlength,maxlength

Re: [validation] Help with 'contains' validation

2005-03-01 Thread Erik Weber
To ignore case, just convert the two Strings to uppercase before you test if one contains the other. Hope I'm understanding the problem correctly . . . Erik Erik Weber wrote: This is untested (!), but adapted from a working twofields validation method (used to make sure password1 matches