Commit 108b4518 by Qiang Xue

Fixes #5049.

parent d3f2010e
...@@ -300,10 +300,7 @@ ...@@ -300,10 +300,7 @@
delete messages[i]; delete messages[i];
} }
} }
if (needAjaxValidation && (!data.submitting || $.isEmptyObject(messages))) { if (needAjaxValidation) {
// Perform ajax validation when at least one input needs it.
// If the validation is triggered by form submission, ajax validation
// should be done only when all inputs pass client validation
var $button = data.submitObject, var $button = data.submitObject,
extData = '&' + data.settings.ajaxParam + '=' + $form.prop('id'); extData = '&' + data.settings.ajaxParam + '=' + $form.prop('id');
if ($button && $button.length && $button.prop('name')) { if ($button && $button.length && $button.prop('name')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment