Duffey, Kevin wrote:

> I actually do a different design for validating forms. I place a hidden
> field before each field I want validated, with a name of validate and a
> value of RegExp names that determine the type of validation to be done. In
> the JS, I loop through all elements, and if the type==hidden and
> name==validate, I get the value, tokenize it into , separated items, then

[snip ...]

Yeah, that works. I was thinking about the Regular expression
but that's only supported in JavaScript1.2 and I usually
have a requirement of earlier browsers. My code also allows
for generic validation functions (what if you need a ","
in your validation RegExp?). Although regular expressions
can do a lot, they can't do everything.

Having hidden fields can cause problems at the server
side depending on the technology you use. Since JSP
and Servlets are flexible in the parameters, it's a
horses for courses. But for both of us, the validate
seems to be the wrong thing.



Reply via email to