mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-11 19:20:01 +08:00
Merge pull request #11715 from uaoleg/patch-4
Fix scope for multiple forms file inputs
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 [];
|
||||
|
||||
Reference in New Issue
Block a user