struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bart Busschots <b...@cs.nuim.ie>
Subject Re: Validator rule question
Date Sun, 09 Apr 2006 13:08:54 GMT
Rivka Shisman wrote:
> Hi Quinn,
>
> As much as I understand the "validwhen" is more like an enhanced
> "requiredif", but I need that the "date" rule on my property be checked
> only when my other property has value "X". I don't think the "validwhen"
> can solve this.
>
> Am I right?
>   
No, the valid when is specifically designed to validate fields based on 
the values of other fields. I posted an example of that a few days ago 
to this list.

Bart.
> Rivka
>
> -----Original Message-----
> From: Quinn Stone [mailto:qstone@stoneconsultants.com] 
> Sent: Saturday, April 08, 2006 8:06 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Validator rule question
>
> Rivka, look into the "validwhen" validation. I think that should do the
> trick.
>
> Q
> -----Original Message-----
> From: Rivka Shisman [mailto:rivka@nite.org.il] 
> Sent: Saturday, April 08, 2006 9:24 AM
> To: Struts Users Mailing List
> Subject: Validator rule question
>
>
> Hello Friends,
>
>  
>
> I have a DynaValidatorForm in which there 2 String properties: action
> and student_birth_date.
>
> I have a date validation like this:
>
>  
>
>             <field
>
>                 property=" student_birth_date"
>
>                 depends="required,date">
>
>                     <arg key="Student birth date" resource="false"
> position="0"/>
>
>                     <arg key="MM/YY" resource="false" position="1"/>
>
>                               <var>
>
>                           <var-name>datePatternStrict</var-name>
>
>                           <var-value>MM/yy</var-value>
>
>                               </var>                   
>
>             </field>
>
>  
>
>  
>
> I need that the validation above to depend on the value of the "action"
> property in the Form (i.e. if action equals "create" or "update" then do
> the validation, else ignore it)
>
>  
>
> How can I do that?
>
>  
>
> Thanks
>
> Rivka
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>   


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


Mime
View raw message