On Sat, May 9, 2009 at 4:31 PM, Laurence MacNeill <[email protected]>wrote:
> I want to have a ZIP code validator ignore the zip code field, if the
> country is not the USA or Canada.
Is it critical that the validator fire when the field loses focus, or would
it be okay if it simply fires when the form is submitted?
When your form is submitted, I assume you're running all your validators
anyway, since otherwise validation could be bypassed.
So you could just make your validator "required='false'" and in the function
that fires when the form is submitted, do something like (pseudo)
if (country="USA" || country="Canada") {
ZipCodeValidator.validate();
}
Most of this validator stuff is covered well in the LiveDocs, by the way.
--
Thanks,
Tom
Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560