diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.coffee index 1a8841d32..3fadb2697 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.coffee @@ -466,9 +466,9 @@ class App.ControllerForm extends App.Controller uncheckParam = {} lookupForm.find('input[type=checkbox]').each( (index) -> type = $(@).data('field-type') - checked = $(@).attr('checked') + checked = $(@).prop('checked') name = $(@).attr('name') - if name && !checked && (!(name of param) || param[name] is '') + if name && !checked && !(name of param) if !(name of uncheckParam) if type is 'boolean' uncheckParam[name] = false @@ -482,7 +482,7 @@ class App.ControllerForm extends App.Controller # verify if we have not checked radios lookupForm.find('input[type=radio]').each( (index) -> type = $(@).data('field-type') - checked = $(@).attr('checked') + checked = $(@).prop('checked') name = $(@).attr('name') if name && !checked && !(name of param) if type is 'boolean' diff --git a/public/assets/tests/form.js b/public/assets/tests/form.js index c49ff44f3..eabd55252 100644 --- a/public/assets/tests/form.js +++ b/public/assets/tests/form.js @@ -1176,3 +1176,92 @@ test("object manager form 2", function() { deepEqual(params, test_params, 'form param check') }); + +test("object manager form 3", function() { + + $('#forms').append('