Fixes #1998 : get input value from hidden field when necessary(unchecked checkbox/radio)

This commit is contained in:
Kevin LEVRON
2014-01-16 14:45:25 +01:00
parent 3c05ee51c8
commit 4527a3dc4c

View File

@ -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();
}