You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matthew Van Horn <ma...@yahoo.com> on 2004/07/20 23:22:01 UTC
Validation headaches
Does anyone know if it is posible to use validatewhen in conjunction
with mask (or other validators)?
I cannot figure out how to make it work. Separately they work fine, but
when I try to use them together it never validates.
Here is the non-working config.
<form name="dynaPhoneNumberForm">
<field property="phoneNumber" depends="validwhen,mask">
<arg0 key="phoneNumber.displayname" />
<var>
<var-name>test</var-name>
<var-value>(submit == 'delete') or (*this* !=
null)</var-value>
</var>
<var>
<var-name>mask</var-name>
<var-value>^\d{4}-\d{4}$</var-value>
</var>
</field>
</form>
I'm using a LookupDispatchAction, and if I am calling delete, I do not
send the phoneNumber field. If I am not deleting, then I would like to
validate this against a regular expression.
(yes, the regex is working OK - they are not U.S. phone numbers.)
--
Matthew Van Horn <ma...@yahoo.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org