How can I modify this example so it can get values from checkboxes that aren\'t checked?
I want all checkboxes to have a value, if it hasn\'t been checked I want to get
serializeArray ignores the checkboxes which are not checked. You can try something like this.
serializeArray
Working demo
var serializedObj = {}; $("form input:checkbox").each(function(){ serializedObj[this.name] = this.checked; });