At 02:29 PM 5/11/2009, you wrote:
Laurence,

Perhaps we missed connections here. In my answer to one of your other validator questions, I mentioned the 'required="false"' attribute.

If you set the source and property values, then "required" to "false," it will always validate that any entry is a proper zip code, and show the error message. But it won't require a value for the field.

So if you place your custom validation, with the conditional code, in the focusOut method, it should work.

The only thing that 'required="false"' gets me is the ability to leave the field blank. Which works great for foreign countries that don't use postal codes. But what about the U.K.? Or Brazil? Or Argentina? Or about 120 other countries that *do* use postal codes?

I want the ability to store foreign ZIP codes in there, not just leave it blank if it's a foreign country. But when there's a foreign postal code in there, I do *not* want the validator to fire. If I set source and property values, it *always* fires. It fires before I can run my conditional "if (selectedCountry == USA || Canada)" check to stop it from firing.

If I *don't* set source and property values, I can use the .validate() method to check and see if I get a .VALID condition. That works fine. But the little red error message *never* appears when I do it that way, even when it's a non-valid USA or Canadian code.

So, do you see my problem here?  :-)

Laurence MacNeill
Mableton, Georgia, USA



-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------


Reply via email to