jquery check if checkbox is not checked
if (!$("#checkboxID").is(":checked")) {
// do something if the checkbox is NOT checked
}
jquery check if checkbox is not checked
if (!$("#checkboxID").is(":checked")) {
// do something if the checkbox is NOT checked
}
jquery validate all checkbox checked
<form id="form1" action="/controller/action" method="post">
<input type="checkbox" name="box1" class="cBox" />
<input type="checkbox" name="box2" class="cBox" />
<input type="checkbox" name="box3" class="cBox" />
<input type="submit" value="Submit" />
</form>
<script>
$('#form1').submit(function() {
if ($('input:checkbox', this).length == $('input:checked', this).length ) {
// everything's fine...
} else {
alert('Please tick all checkboxes!');
return false;
}
});
</script>
jquery check if all checkbox is not checked
$('#checkAll').click(function () {
$('input:checkbox').prop('checked', this.checked);
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us