Fix #8225: Fixed AJAX validation with checkboxList was only triggered on first select

This commit is contained in:
Yuriy Mamaev
2019-10-22 12:32:41 +03:00
committed by Alexander Makarov
parent d7f69b6676
commit 40fff67aa4
3 changed files with 31 additions and 0 deletions

View File

@ -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') + '"]');
}