Skip to content

Commit

Permalink
fixed asyncfunccall to prevent returning with load message if callbac…
Browse files Browse the repository at this point in the history
…k returns too quickly
  • Loading branch information
jkapelner committed Apr 11, 2015
1 parent 6df21b1 commit 9bb83ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/jquery.validationEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,12 @@
}
});

return rule.alertTextLoad;
if (options.asyncInProgress[field.attr("id")]) {
return rule.alertTextLoad; //if async function is still in progress, show the loading prompt
}
else if (options.ajaxValidCache[field.attr("id")] === false) { //if the callback returned quickly and validation failed
return {status: '_error_no_prompt'}; //force our caller to fail and bail (don't change the prompt, since that was already done by the callback)
}
}
else if (options.ajaxValidCache[field.attr("id")] === false) { //if validation previously failed, but did not change
return {status: '_error_no_prompt'}; //force our caller to fail and bail (don't change the prompt)
Expand Down

0 comments on commit 9bb83ae

Please sign in to comment.