Javascript: A simple way when validating forms to ensure at least one checkbox is checked

Check so at least one checkbox on your form is checked before it’s allowed to submit:


   if ( $("input[type='checkbox']:checked").length > 0) {

   else {

         alert("Please check at least one list you wish to be included in.");
         return false;

   return true;



Aaron Belchamber has written 247 articles

Leave a Reply

Your email address will not be published. Required fields are marked *