You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2006/04/25 21:17:46 UTC

[jira] Reopened: (STR-856) validation order is incorrect

     [ http://issues.apache.org/struts/browse/STR-856?page=all ]
     
Don Brown reopened STR-856:
---------------------------

    Assign To:     (was: Struts Developer Mailing List)

> validation order is incorrect
> -----------------------------
>
>          Key: STR-856
>          URL: http://issues.apache.org/struts/browse/STR-856
>      Project: Struts Action 1
>         Type: Improvement

>   Components: Action
>     Versions: Nightly Build
>  Environment: Operating System: All
> Platform: PC
>     Reporter: Piotr Kania
>     Priority: Minor

>
> Validator framework generates such JavaScript function to validate form:
> function validateLoginForm(form) {                                             
>                      
>         if (bCancel) 
>       return true; 
>         else 
>        return validateRequired(form) && validateMaxLength(form); 
>    } 
> The validation stops if <b>ANY</b> property is empty. I think it should check
> <b>ALL<b> properties first and then return errors for all properties.
> For example I have such form:
> <form name="loginForm">
>   <field property="username" depends="required,minlength">
>      <arg0 key="login.username"/>
>      <arg1 name="minlength" key="${var:minlength}" resource="false"/>
>         <var>
> 	   <var-name>minlength</var-name>
> 	   <var-value>7</var-value>
> 	</var>
>   </field>
>   <field property="password" depends="required">
>      <arg0   key="login.password"/>
>   </field>
> </form>
> 1) If I fill "username" property with short text e.g. "tom" and try to submit I
> will get message "Field Password is required". 
> 2) So If I fill "password" property and try to submit I will get message
> "Username can not be less than 7 characters."
> In my opinion validator shoud return at step 1 two messages:
> "Field Password is required."
> "Username can not be less than 7 characters."

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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