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
I’m not exactly sure what you’re looking for here. Here’s how to do it for one fieldset:
I made a little example you can try too: http://jsfiddle.net/nzLpr/