Posted By

vagrantradio on 09/20/11


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

asteris
spee66


Check If One Checkbox Is Checked


 / Published in: jQuery
 

  1. $("#formId").submit(function(){
  2. var checked = $("#formId input:checked").length > 0;
  3. if (!checked){
  4. alert("Please check at least one checkbox");
  5. return false;
  6. }
  7. });

Report this snippet  

You need to login to post a comment.