I don't think that's surprising behaviour. It sounds like what you really need is a 'maskIf' test. You could possibly roll your own from the requiredif and mask.


On 10/25/2004 05:12 PM David Schneider wrote:
hi.  i'm using struts 1.1 and have a question about combining requiredif
with other validation rules.  i have

<field property="zip" depends="requiredif, mask">
      <msg name="requiredif" key="CustomerInfoForm.zip.invalid"/>
      <msg name="mask" key="CustomerInfoForm.zip.invalid"/>
      <var>
            <var-name>field[0]</var-name>
            <var-value>country</var-value>
      </var>
      <var>
            <var-name>fieldTest[0]</var-name>
            <var-value>EQUAL</var-value>
      </var>
      <var>
            <var-name>fieldValue[0]</var-name>
            <var-value>840</var-value>
      </var>
      <var>
            <var-name>mask</var-name>
            <var-value>${uszipmask}</var-value>
      </var>
      <field>

if a user chooses a country other than 840 (usa) and leaves the zip blank,
then the form passes validation.  however, if he chooses a country other
than 840 and enters something in the zip field then the mask is applied to
that value.  i would like the mask rule to be bypassed also if the country
isn't 840.  is this possible?


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



Reply via email to