mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 11:39:41 +08:00
Fix #8225: Fixed AJAX validation with checkboxList was only triggered on first select
This commit is contained in:
committed by
Alexander Makarov
parent
d7f69b6676
commit
40fff67aa4
@ -876,6 +876,14 @@
|
||||
var type = $input.attr('type');
|
||||
if (type === 'checkbox' || type === 'radio') {
|
||||
var $realInput = $input.filter(':checked');
|
||||
if ($realInput.length > 1) {
|
||||
var values = [];
|
||||
$realInput.each(function(index) {
|
||||
values.push($($realInput.get(index)).val());
|
||||
});
|
||||
return values;
|
||||
}
|
||||
|
||||
if (!$realInput.length) {
|
||||
$realInput = $form.find('input[type=hidden][name="' + $input.attr('name') + '"]');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user