You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michelle Wynn <mw...@csc.com> on 2002/12/17 22:45:44 UTC

restricting to a specific field length

I want to validate a field that must be alphanumeric and must be a X number
of characters long.   Is there a clean way to leverage the basic struts
validators for this or does this have to be a custom validation?

I know I could use a combination of the minlength and maxlength functions
but this sounds like a sloppy way to go.  I don't want to give them 2 error
messages when I just want to say "Your field must be X characters" (as
opposed to "Your field cannot be less than X" and/or"Your field cannot be
greater than X").

I could mask out to the desired number of characters but I want the error
message to say something more meaningful than "The field is invalid".

Any one deal with this before?

Thanks!




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>