The generated Javascript groups tests by type (required, mask, min length
etc) and calls them as follows:
function validateRegistrationForm(form) {
if (bCancel)
return true;
else
return validateRequired(form) &&
validateMask(form) &&
validateMinLength(form) &&
validateMaxLength(form) &&
validateEmail(form);
}
Due to the way the && expression is evaluated, if any test returns true the
subsequent tests are not executed.
If you had several missing required fields then those errors would be
grouped together. But if you had only one missing required field and another
type of error, you would not see the second error message until you correct
the missing field error.
See the struts-validator sample application (shipped with Struts) for
examples.
Steve
> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Brian Chaplin
> Sent: July 26, 2003 10:35 AM
> To: [EMAIL PROTECTED]
> Subject: Can Validator javascript show more than one error at a time?
>
>
> Somehow Ted Husted was able to get the javascript to show more than one
> error at a time in the javascript alert message.
> See screen shot on page 373 of Struts in Action.
> I'm using Struts 1.1 final and it seems the javascript won't support that?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]