Merge pull request #11715 from uaoleg/patch-4

Fix scope for multiple forms file inputs
This commit is contained in:
Dmitry Naumenko
2016-08-05 17:26:08 +03:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -303,6 +303,7 @@
// client-side validation
$.each(data.attributes, function () {
this.$form = $form;
if (!$(this.input).is(":disabled")) {
this.cancelled = false;
// perform validation only if the form is being submitted or if an attribute is pending validation

View File

@@ -383,7 +383,7 @@ yii.validation = (function ($) {
return [];
}
var files = $(attribute.input).get(0).files;
var files = $(attribute.input, attribute.$form).get(0).files;
if (!files) {
messages.push(options.message);
return [];