struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mon Cab <futo...@yahoo.com>
Subject Problems with "validwhen"
Date Sat, 12 Nov 2005 23:26:06 GMT

I am trying to use validwhen to make sure that
validator only requires a valid State and Zip if the
country selected is "United States".

But I am getting required error messages from both
state and zip when the form is submitted without these
values.
 
I am using the following config for validator:

            
<field	property="state"		
	depends="required,validwhen,mask">

	<var>
	  <var-name>test</var-name>
	  <var-value>(country=="United States")</var-value>
	</var>
	<var>
	  <var-name>mask</var-name>
	  <var-value>^[A-Z]{2}$</var-value>
	</var>
</field>
            
<field
	property="zip"
	depends="required,validwhen,mask">
	
	<var>
 	  <var-name>test</var-name>
	  <var-value>(country=="United States")</var-value>
	</var>

	<var>
	  <var-name>mask</var-name>
  	  <var-value>^\d{5}$</var-value>
	</var>   
 </field>

Is this wrong?  What should I be doing here?  






	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Mime
View raw message