mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-30 18:17:00 +08:00
Bug #15826: Fixed JavaScript compareValidator in yii.validation.js for attributes not in rules (mgrechanik)
This commit is contained in:
committed by
Alexander Makarov
parent
71424a42fa
commit
1ad85c640b
@ -274,12 +274,11 @@ yii.validation = (function ($) {
|
||||
if (options.compareAttribute === undefined) {
|
||||
compareValue = options.compareValue;
|
||||
} else {
|
||||
var attributes = $form.data('yiiActiveForm').attributes
|
||||
for (var i = attributes.length - 1; i >= 0; i--) {
|
||||
if (attributes[i].id === options.compareAttribute) {
|
||||
compareValue = $(attributes[i].input).val();
|
||||
}
|
||||
var $target = $('#' + options.compareAttribute);
|
||||
if (!$target.length) {
|
||||
$target = $form.find('[name="' + options.compareAttributeName + '"]');
|
||||
}
|
||||
compareValue = $target.val();
|
||||
}
|
||||
|
||||
if (options.type === 'number') {
|
||||
|
||||
Reference in New Issue
Block a user