how to loop throw all the Fileds in the view to check wheather checkbox is checked or not using jque

Posted by kumar on Stack Overflow See other posts from Stack Overflow or by kumar
Published on 2010-05-28T16:13:29Z Indexed on 2010/05/28 16:22 UTC
Read the original article Hit count: 152

Filed under:

Hello friends.

I have this code I am checking wheather checkbox i checked or not..

  $('#btnsubmit').click(function() {
        $('#Details input[type=checkbox]').each(function() {
            if ($(this).attr('checked')) {
                  alert("selected");
                  return false;
            } else {
                alert("please select atleast one user");
                return false;
            }
        });
    });

here var checked showing true or false..

I have deatils Fieldset in the view.. like that each field set having one check box.. like that there are three fieldsets with one check box..I need to know how many details checkbox is checked? can I loop each Details Fieldset to know how many details checkboxes are cheked?

thanks

© Stack Overflow or respective owner

Related posts about jQuery