Yes. In Struts 1.1b2, all built-in rules (except the required rule) had a depends attribute which was set to "required" in the validator-rules.xml file. With this setup, when you used a minlength rule without explicitly specifying the required rule and the user did not enter anything, the required rule would still get invoked and validation would fail. Even if you removed the required rule dependency in validator-rules.xml, the minlength rule will fail. This caused a problem with optional fields. In Struts 1.1b3, this dependency was removed in validator-rules.xml and the implementation was modified. So, all you have to do for this optional field is to specify just the minlength rule (without specifying the required rule). For all other required fields, specify the required rule and any other rule in the depends attribute.
----- Original Message ----- From: "Phase Web and Multimedia" <[EMAIL PROTECTED]> To: "Struts User List" <[EMAIL PROTECTED]> Sent: Wednesday, January 15, 2003 10:06 PM Subject: [Validator] Validating only when the element has a property > I am trying to validate a field only when it has a value. I am trying to > establish a minlength. If i send the field empty i get an ActionError saying > it is not long enough. But, it is not a required field. I only want to > validate it when it has a value. Is this possible? > > Brandon Goodin > Phase Web and Multimedia > P (406) 862-2245 > F (406) 862-0354 > [EMAIL PROTECTED] > http://www.phase.ws > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.435 / Virus Database: 244 - Release Date: 1/2/2003 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

