Skip to content

Commit ce30049

Browse files
committed
fixed asyncfunccall to prevent returning with load message if callback returns too quickly
1 parent 5a1ec40 commit ce30049

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
@@ -1148,7 +1148,12 @@
11481148
}
11491149
});
11501150

1151-
return rule.alertTextLoad;
1151+
if (options.asyncInProgress[field.attr("id")]) {
1152+
return rule.alertTextLoad; //if async function is still in progress, show the loading prompt
1153+
}
1154+
else if (options.ajaxValidCache[field.attr("id")] === false) { //if the callback returned quickly and validation failed
1155+
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)
1156+
}
11521157
}
11531158
else if (options.ajaxValidCache[field.attr("id")] === false) { //if validation previously failed, but did not change
11541159
return {status: '_error_no_prompt'}; //force our caller to fail and bail (don't change the prompt)

0 commit comments

Comments
 (0)