Matt,

Have you tried putting just white spaces in the field for first name in the
third test case.  It will pass which is incorrect, that's the part I don't
understand and got stucked on.  It looked like validwhen treated all
whitespace string value for a field the same way as the field is null.

-Betty

-----Original Message-----
From: Matt Bathje [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 06, 2005 2:30 PM
To: Struts Users Mailing List
Subject: Re: ValidWhen validation


Betty Koon wrote:
> It's Server side.
> 
> -Betty
> 
> -----Original Message-----
> From: Matt Bathje [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 06, 2005 2:15 PM
> To: Struts Users Mailing List
> Subject: Re: ValidWhen validation
> 
> 
> Betty Koon wrote:
> 
>>My question is even if I type 123 in the field, it still complains
>>about the field is required??  I am really confused now ...
>>
> 


So I just attempted to duplicate what you are doing with this validation:

<field property="firstName" depends="validwhen,mask">
   <arg0 key="label.firstName" />       
     <var>
       <var-name>test</var-name>
       <var-value>((lastName == 'false') or (*this* != null))</var-value>
     </var>
     <var>
       <var-name>mask</var-name>
       <var-value>^123$</var-value>
     </var>
</field>

and it seems to work as expected.

lastName=false; firstname=(blank): submits
lastName=false; firstname=123: submits
lastName=false; firstName=asdf: invalid firstName error lastName=(blank);
firstname=(blank): firstname is required error lastname=(blank);
firstname=123: submits lastname=(blank); firstname=asdf: invalid firstname
error


So....something else hinky must be going on. Can you post the validator 
code again?


Matt

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to