I have a set of checkboxes which when checked they pass the value as 1, otherwise they pass the value as 0. However, instead of sending the value of the unchecked checkboxes as '0', the value being sent is 'NULL'.I have the following JS code in place that should set the value to 0/1 accordingly, however still the value is sent as NULL. Is there anything that can be done to make sure that the value passed in case of an unchecked checkbox is 0?\[code\]$('#cb1, #cb2, #cb3, #cb4').on('click', function () $(this).val(this.checked ? 1 : 0);});\[/code\]UPDATEDHere is my html:\[code\]<input type="checkbox" name="cb1" id="cb1" value="http://stackoverflow.com/questions/14067215/1" checked /><input type="checkbox" name="cb2" id="cb2" value="http://stackoverflow.com/questions/14067215/1" checked /><input type="checkbox" name="cb3" id="cb3" value="http://stackoverflow.com/questions/14067215/1" checked /><input type="checkbox" name="cb4" id="cb4" value="http://stackoverflow.com/questions/14067215/1" checked />\[/code\]They are all checked by default.If one of them is unchecked, MySQL is reporting the following error:0SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'ColumnName' cannot be null. This is because the columns are set to set not to be Null. And even though I have set the default value to 0, once I click on the submit button I still get the error. I tried to remove the Not NULL property however rather than prefilling the value as 0, the input was NULL in the database.