Great Thanks, I am using 1.1b3 but I did not update my validation-rules.xml.
I will replace that with the 1.1b3 version and see if it works. When I place
minlenght alone it still validates the input. But if i use
"integer,minlength" it works. kinda wierd huh? Anyways, thanks for the help.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-----Original Message-----
From: Giri Alwar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 12:56 PM
To: Struts Users Mailing List
Subject: Re: [Validator] Validating only when the element has a property


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]>



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

Reply via email to