function ajaxCheckEmail(str,fn) {
...
$.post(..., function(json) {
...
}$.post(..., function(json) {
...
fn(args.success); // fn gets success value as parameter
...
});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/
