At 06:21 PM 5/9/2009, you wrote:
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?

I'd like it to fire when the field loses focus, so the typist knows immediately when they've made a mistake. Ideally, it would fire, and return focus to the ZipCode field, so they cannot continue 'till they've fixed the mistake. (See my earlier post about setFocus() not behaving properly...)


When your form is submitted, I assume you're running all your validators anyway, since otherwise validation could be bypassed.

That hadn't occurred to me. Running the validators when the form is submitted, I mean... Guess I need to do that too. :-)


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();
}

Right -- I have something like that now for the focusOut event on the ZipCode field. Problem I have is, I want it to pop up the "tooltip" when the code is invalid -- but it doesn't do that when I use a validation function like that. How do I fix that problem?


Most of this validator stuff is covered well in the LiveDocs, by the way.

I find LiveDocs very confusing. It's hard for me to find what I need in there. Maybe I need a tutorial on how to use LiveDocs. :-) All those packages and what not -- I rarely know exactly what package I'm looking for, so it's hard to find the right one to drill down into the answer I'm looking for. And the search-box never seems to find the right thing for me. So I just ask questions here instead, if I can't find the answer on Google. <GRIN>

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