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
You can append unchecked checkbox data to .serializeArray
result:
var formData = $("#mybaseelement").serializeArray();
$('#mybaseelement input[type="checkbox"]:not(:checked)').each(function(i, e) {
formData.push({name: e.getAttribute("name"), value: false});
});
This is the least invasive solution I can come up with.