Commit 4527a3dc by Kevin LEVRON

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

parent 3c05ee51
...@@ -381,7 +381,11 @@ ...@@ -381,7 +381,11 @@
var $input = findInput($form, attribute); var $input = findInput($form, attribute);
var type = $input.prop('type'); var type = $input.prop('type');
if (type === 'checkbox' || type === 'radio') { 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 { } else {
return $input.val(); return $input.val();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment