commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: Validation on An optional field that if supplied passes a validation
Date Wed, 26 May 2004 13:20:09 GMT
If you're using this from Struts, the FieldChecks methods only run the
validation if the value is supplied so using just email will work for
optional fields (use required and email for non-optional fields).  

If you're using this in a non-Struts app you need to front EmailValidator
with your own method that only runs the validation when the value is not
null similar to FieldChecks.  We're currently working on adding fully
functional validators so you won't have to do this in the future.

David

--- Mike Tedesco <Mike_Tedesco@skillsoft.com> wrote:
> Can someone tell me how I set up a form validation in my xml that can be
> optional (i.e. passed as null). But if it is supplied then I can perform
> the validation
>  
> <field
> 
> property="email2"
> 
> depends="email">
> 
> <arg0 key="ilt.Email2"/>
> 
> </field>
> 
>  
> 
> Like above I want only the email validation to be performed if the field
> is not null.
> 
>  
> 
> -- Thanks
> 
> 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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


Mime
View raw message