Doh! I knew there was a reason I usually put the validation response in the callback instead of somewhere else. You could try passing a callback function as a parameter to the check, and then running that function inside the post callback. ie:
function ajaxCheckEmail(str,fn) {
...
$.post(..., function(json) {
...
fn(args.success); // fn gets success value as parameter
...
});
...
}

So you would use it like this:
ajaxCheckEmail("[EMAIL PROTECTED]",function(valid) { if (!valid) alert("This is not a valid email address!"); });

On 11/2/06, bmsterling <[EMAIL PROTECTED]> wrote:

That is what I initially started out doing, but for some reason it was not
working out according to plan.  I am think it was not working because, as
the ajax part was excuting, the rest of the js was running its course.  Is
there a way to stop the progression until the variable has a value?
--
View this message in context: http://www.nabble.com/form-validation-w--simple-ajax-tf2554683.html#a7127830
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to