Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery check if checkbox is not checked

if (!$("#checkboxID").is(":checked")) {
    // do something if the checkbox is NOT checked
}
Comment

jquery checkbox checked or not

$('input[type="checkbox"]').click(function(){
            if($(this).is(":checked")){
                console.log("Checkbox is checked.");
            }
            else if($(this).is(":not(:checked)")){
                console.log("Checkbox is unchecked.");
            }
        });
Comment

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>
Comment

jquery checkbox checked or not

<script>
    $(document).ready(function(){
        $('input[type="checkbox"]').click(function(){
            if($(this).prop("checked") == true){
                console.log("Checkbox is checked.");
            }
            else if($(this).prop("checked") == false){
                console.log("Checkbox is unchecked.");
            }
        });
    });
Comment

jquery check if all checkbox is not checked

 $('#checkAll').click(function () {    
     $('input:checkbox').prop('checked', this.checked);    
 });
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery select first matching element 
Javascript :: javascript get last object in foreach loop 
Javascript :: format date javascript 
Javascript :: get all image tags javascript 
Javascript :: post method 
Javascript :: post jquery 
Javascript :: express-async-errors 
Javascript :: form data object 
Javascript :: delete all objects in array of objects with specific attribute 
Javascript :: react scroll to bottom 
Javascript :: js get selected option elemeng 
Javascript :: jquery parent 
Javascript :: Use Multiple Conditional Ternary Operators Javascript 
Javascript :: kendo treeview get selected node data 
Javascript :: validationResult is not defined 
Javascript :: add checkbox dynamically in javascript 
Javascript :: char array to string javascript 
Javascript :: send mail, nodemailer, nodemailer, mailer, nodemailer npm 
Javascript :: what is JSON TREE 
Javascript :: react compress image 
Javascript :: javascript convert to array 
Javascript :: javascript create node from innerhtml 
Javascript :: script tag inside react component 
Javascript :: dropdown validation using jquery 
Javascript :: js fetch api 
Javascript :: react native vector icons not showing 
Javascript :: status 502 bad api gateway error solution for aws lambda 
Javascript :: lpad javascript 
Javascript :: reverse array javascript 
Javascript :: remove object in array javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =