Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery validate checkbox before submit

$(document).ready(function() {
    $('#form1').submit(function() {
        if ($('input:checkbox', this).length == $('input:checked', this).length ) {
            // everything's fine...
        } else {
            alert('Please tick all checkboxes!');
            return false;
        }
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #validate #checkbox #submit
ADD COMMENT
Topic
Name
2+9 =