Fixed #14901: fixed both implementation and test of trim() JavaScript validator

This commit is contained in:
Alexander Makarov
2018-09-08 02:12:34 +03:00
parent cd442339df
commit 8b3da74fc0
2 changed files with 30 additions and 3 deletions

View File

@ -238,9 +238,7 @@ yii.validation = (function ($) {
trim: function ($form, attribute, options, value) {
var $input = $form.find(attribute.input);
var isCheckAble = $input.find('[type=radio]').is('[type=radio]') || $input.find('[type=checkbox]').is('[type=checkbox]');
if (!isCheckAble) {
if ($input.is(':checkbox, :radio')) {
return value;
}