mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Fixes #1998 : get input value from hidden field when necessary(unchecked checkbox/radio)
This commit is contained in:
@ -381,7 +381,11 @@
|
||||
var $input = findInput($form, attribute);
|
||||
var type = $input.prop('type');
|
||||
if (type === 'checkbox' || type === 'radio') {
|
||||
return $input.filter(':checked').val();
|
||||
var $realInput = $input.filter(':checked');
|
||||
if (!$realInput.length) {
|
||||
$realInput = $form.find('input[type=hidden][name="'+$input.prop('name')+'"]');
|
||||
}
|
||||
return $realInput.val();
|
||||
} else {
|
||||
return $input.val();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user