Fixes #13932: Fix number validator attributes comparison

This commit is contained in:
Evgeniy Moiseenko
2018-10-19 23:56:30 +03:00
committed by Alexander Makarov
parent cfe0bf5cf1
commit dfe828f76b
3 changed files with 39 additions and 3 deletions

View File

@ -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 '==':