When a checkbox is left blank I want it to carry the value "false" and when the checkbox is checked I want it to carry the value "true".
<label for="windscreen"><b>Windscreen</b></label>
<input class="form-control" id="windscreen" type="checkbox" name="windscreen">
<label for="heatedchairs"><b>Heated Chairs</b></label>
<input class="form-control" id="heatedchairs" type="checkbox" name="heatedchairs">
<label for="indicators"><b>Indicators</b></label>
<input class="form-control" id="indicators" type="checkbox" name="indicators">
<input class="btn btn-primary" type="submit" id="register" name="create" value="Sign up">
<script
function register {
document.getElementById("windscreen").checked = true;
document.getElementById("windscreen").checked = false;
}>
</script>
I have tried this for one of my checkboxes that has the id="windscreen", but it didn't do anything
When the checkbox is checked it will return the value true and when it is unchecked it returns the value false. So in the database it will be saved as false or true, instead of it all being "on" as it is at the moment