mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-31 02:28:35 +08:00
Fixes #13932: Fix number validator attributes comparison
This commit is contained in:
committed by
Alexander Makarov
parent
cfe0bf5cf1
commit
dfe828f76b
@ -282,12 +282,12 @@ yii.validation = (function ($) {
|
||||
if (!$target.length) {
|
||||
$target = $form.find('[name="' + options.compareAttributeName + '"]');
|
||||
}
|
||||
compareValue = $target.val();
|
||||
compareValue = $target.val();
|
||||
}
|
||||
|
||||
if (options.type === 'number') {
|
||||
value = parseFloat(value);
|
||||
compareValue = parseFloat(compareValue);
|
||||
value = value ? parseFloat(value) : 0;
|
||||
compareValue = compareValue ? parseFloat(compareValue) : 0;
|
||||
}
|
||||
switch (options.operator) {
|
||||
case '==':
|
||||
|
||||
Reference in New Issue
Block a user