You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Mulligan, Scott H" <sc...@eds.com> on 2006/05/04 21:29:20 UTC

Validator stops when an error is encountered

The validate javascript function that gets generated by the validator
stops processing once one of the validation routines finds an error. Is
there a way to override the "&&" with "&" so that I can get all errors
at once? If so, where would I do this?

    function validateSignIn(form) {

        if (bCancel) 
      return true; 
        else 
       return validateMaxLength(form) && validateRequired(form) &&
validateMinLength(form); 
   }  

I searched the archives, but did not see any solutions to this. Any help
would be appreciated.

Scott Mulligan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validator stops when an error is encountered

Posted by Niall Pemberton <ni...@gmail.com>.
On 5/4/06, Mulligan, Scott H <sc...@eds.com> wrote:
> The validate javascript function that gets generated by the validator
> stops processing once one of the validation routines finds an error. Is
> there a way to override the "&&" with "&" so that I can get all errors
> at once? If so, where would I do this?
>
>    function validateSignIn(form) {
>
>        if (bCancel)
>      return true;
>        else
>       return validateMaxLength(form) && validateRequired(form) &&
> validateMinLength(form);
>   }
>
> I searched the archives, but did not see any solutions to this. Any help
> would be appreciated.

In the struts-config.xml you can set the "stopOnFirstError" property
to false....

  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames"
                              value="/WEB-INF/validator-rules.xml,
                                        /WEB-INF/validation.xml"/>
    <set-property property="stopOnFirstError" value="false"/>
  </plug-in>


Niall

> Scott Mulligan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org