struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@albany.edu
Subject Re: Bug in Validator javascript, not showing all errors?
Date Wed, 25 Feb 2004 19:18:22 GMT


File = struts-config.xml >> Validator plugin elements:
  <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>

File = login.jsp >> form declaration:
...
<html:form action="console" onsubmit="return validate[BLAH](this)">
...

Where [BLAH] is the name of the action which handles your form submition.

I'm a newbie, so if there's a better way fire away people.
-Ryan

On Wed, 25 Feb 2004, Mike Millson wrote:

> I have a form with 1 text field and 1 password field:
> username: required and maxlength 10
> password: required
>
> The return statement for the validateLoginForm function generated in the
> dynamic javascript:
>
> return validateMaxLength(form) && validateRequired(form);
>
> If I enter a username that is too long, validateMaxLength returns false, so validateRequired
is never evaluated. The result is that only the error about username being too long is displayed,
even if password is empty.
>
> This is not how it works on the server side. If I disable javascript and submit, the
server side displays both errors: username too long and password required.
>
> Is this a bug? Why aren't the client side and server side validation
> results equal?
>
> Thank you,
> Mike
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

|----------------------------------|
| Ryan Russo                       |
| russo@[noSPAM].albany.edu        |
| University at Albany--Computing  |
| <<remove [noSPAM] to e-mail>>    |
| Technical Services Web Team      |
|__________________________________|

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


Mime
View raw message