struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poon, Johnny" <Johnny.P...@ANICO.com>
Subject validator validwhen not working?
Date Wed, 09 Jul 2003 16:46:36 GMT
Hi,

I'm trying to use validwhen, so that it's only valid when either all three
related fields are empty or are filled, it's valid; otherwise not.  ssn_1,
ssn_2, and ssn_3 are the field names.  For some reason, when I put this in,
none of the validation takes place, not even required, minlength, maxlength,
nor mask, which all worked before I put validwhen in there.  Did I do
anything wrong?

Here's the one of the fields in my validation.xml file:

<field property="ssn_1" depends="validwhen, required, minlength, maxlength,
mask">
	<msg name="required" key="errors.required.enter" />
	<msg name="minlength" key="errors.minlength.digit" />
	<msg name="maxlength" key="errors.maxlength.digit" />
	<msg name="mask" key="errors.mask.numeric" />
	<arg0 key="ssn_1.displayName" />
	<arg1 name="minlength" key="${var:minlength}" resource="false" />
	<arg1 name="maxlength" key="${var:maxlength}" resource="false" />
	<var>
		<var-name>test</var-name>
		<var-value>( (*this* == null) and (ssn_2 == null) and (ssn_3
== null) )</var-value>
	</var>
	<var>
			<var-name>minlength</var-name>
			<var-value>3</var-value>
	</var>
	<var>
			<var-name>maxlength</var-name>
			<var-value>3</var-value>
	</var>
	<var>
			<var-name>mask</var-name>
			<var-value>^\d*$</var-value>
	</var>
</field>

Thanks.

JP.


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


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


Mime
View raw message