mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-12 03:30:12 +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
|
// client-side validation
|
||||||
$.each(data.attributes, function () {
|
$.each(data.attributes, function () {
|
||||||
|
this.$form = $form;
|
||||||
if (!$(this.input).is(":disabled")) {
|
if (!$(this.input).is(":disabled")) {
|
||||||
this.cancelled = false;
|
this.cancelled = false;
|
||||||
// perform validation only if the form is being submitted or if an attribute is pending validation
|
// perform validation only if the form is being submitted or if an attribute is pending validation
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ yii.validation = (function ($) {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
var files = $(attribute.input).get(0).files;
|
var files = $(attribute.input, attribute.$form).get(0).files;
|
||||||
if (!files) {
|
if (!files) {
|
||||||
messages.push(options.message);
|
messages.push(options.message);
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
Reference in New Issue
Block a user