Search
 
SCRIPT & CODE EXAMPLE
 

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;
        }
    });
});
Comment

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;
        }
    });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: generate random whole number between 2 javascript 
Javascript :: javascript string remove backslash 
Javascript :: get element by id in javascript 
Javascript :: convert date to millisecond in javascript 
Javascript :: fs.writefilesync in nodejs 
Javascript :: how to show day name in javascript using array 
Javascript :: javascript set width percentage update 
Javascript :: javascript count instances in string 
Javascript :: js datetime local 
Javascript :: javascript validate date 
Javascript :: read all file names of folder in react 
Javascript :: javascript add class 
Javascript :: find lowest number in array js 
Javascript :: vscode js brackets not close 
Javascript :: javascript pass all arguments to another function 
Javascript :: save text to file nodejs 
Javascript :: jquery append element to body 
Javascript :: js get option value 
Javascript :: refresh after delete in node 
Javascript :: React does not recognize the `activeClassName` prop on a DOM element 
Javascript :: lodash remove undefined values from object 
Javascript :: string to html 
Javascript :: handle error in promise chain 
Javascript :: uuid timestamp for javascript 
Javascript :: javascript combine dictionaries 
Javascript :: javascript write all the prime numbers from 1 to 100 
Javascript :: difference between call and apply in js 
Javascript :: how to split a name js 
Javascript :: javascript get boolean if checkbox is checked 
Javascript :: get file extention js 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =