Re: requiredif combined with other validation rules

2004-10-26 Thread Adam Hardy
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-namefield[0]/var-name
var-valuecountry/var-value
  /var
  var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
  /var
  var
var-namefieldValue[0]/var-name
var-value840/var-value
  /var
  var
var-namemask/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]


requiredif combined with other validation rules

2004-10-25 Thread David Schneider
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-namefield[0]/var-name
var-valuecountry/var-value
  /var
  var
var-namefieldTest[0]/var-name
var-valueEQUAL/var-value
  /var
  var
var-namefieldValue[0]/var-name
var-value840/var-value
  /var
  var
var-namemask/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]