Skip to content

Commit 9bb83ae

Browse files
committed
fixed asyncfunccall to prevent returning with load message if callback returns too quickly
1 parent 6df21b1 commit 9bb83ae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/jquery.validationEngine.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,12 @@
11941194
}
11951195
});
11961196

1197-
return rule.alertTextLoad;
1197+
if (options.asyncInProgress[field.attr("id")]) {
1198+
return rule.alertTextLoad; //if async function is still in progress, show the loading prompt
1199+
}
1200+
else if (options.ajaxValidCache[field.attr("id")] === false) { //if the callback returned quickly and validation failed
1201+
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)
1202+
}
11981203
}
11991204
else if (options.ajaxValidCache[field.attr("id")] === false) { //if validation previously failed, but did not change
12001205
return {status: '_error_no_prompt'}; //force our caller to fail and bail (don't change the prompt)

0 commit comments

Comments
 (0)