You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Durham David R Jr Ctr 805 CSPTS/SCE <Da...@scott.af.mil> on 2005/06/01 21:38:59 UTC

RE: Automatic validation question...

> -----Original Message-----
> From: N G [mailto:nistarguy@gmail.com]
> Sent: Tuesday, May 31, 2005 3:37 PM
> To: Struts-user
> Subject: Automatic validation question...
> 
> If I have set up validation as follows:
> 
> <field property="myField" depends="validwhen, required">
>       <arg0 key="myForm.FirstName"/>
>         <var>
>           <var-name>test</var-name>
>           <var-value>(radioButton = "firstNameSearch")var-value>
>         </var>
> </field>
> 
> If "validwhen" failts, will it try to validate the "required"?

I'm pretty sure it will go through all of the "depends" so that it can
display *all* of the validation errors.  Try it and see.

- Dave 

> In other words, when using automatic validation, the validator goes
> through the list in "depends" and quits as soon as something is not
> valid or does it keep going?
> 
> Also, does my "validwhen" look right? I have different types of
> searches on my form and depending on which search (radio button) 
> the user clicks, different fields are required. So, if the user 
> clicks on "First Name Search", the first name field will be required. 
> Did I set it up correctly?

Why not use requiredif?


- Dave

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