mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Update yii.activeForm.js
remove empty message arrays
This commit is contained in:
@ -299,6 +299,12 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$.when.apply(this, deferreds).always(function() {
|
$.when.apply(this, deferreds).always(function() {
|
||||||
|
//Remove empty message arrays
|
||||||
|
for (var i in messages) {
|
||||||
|
if (0 === messages[i].length) {
|
||||||
|
delete messages[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
if (needAjaxValidation && (!data.submitting || $.isEmptyObject(messages))) {
|
if (needAjaxValidation && (!data.submitting || $.isEmptyObject(messages))) {
|
||||||
// Perform ajax validation when at least one input needs it.
|
// Perform ajax validation when at least one input needs it.
|
||||||
// If the validation is triggered by form submission, ajax validation
|
// If the validation is triggered by form submission, ajax validation
|
||||||
|
|||||||
Reference in New Issue
Block a user