macek/jquery-serialize-object

Unable to serialize checkbox values after change

rvarma1848 opened this issue · 3 comments

I have a input form field that is checkbox. initially it is not checked. After checking the field becomes checked. However, when I try to serelizeObject, I do not see the value

However, if the field is loaded as checked during initial form load, then serialObject picks it up.

What am I missing?

Krish

I have following code in coffeescript to print out the issue

form_object = @$('form').serializeObject()
console.log(@$('form'))
console.log(form_object)

the form shows checked=checked value
however, the from_object does not set enable=true

Here is the video I captured from chrome console. It's such a pain to copy console.log to paste.

https://www.dropbox.com/s/62zhgpxvjikxs3v/UnableToProcess_Checkbox.swf?dl=0

👍 it appears that this other package provides a default value for unchecked Checkboxes:
https://github.com/marioizquierdo/jquery.serializeJSON

macek commented

Duplicate of #33