Skip to content

Instantly share code, notes, and snippets.

@rajvanshipradeep15
Created September 8, 2013 15:07
Show Gist options
  • Save rajvanshipradeep15/6485441 to your computer and use it in GitHub Desktop.
Save rajvanshipradeep15/6485441 to your computer and use it in GitHub Desktop.
php checkboxes code
$('#' + id).is(":checked")
that gets if the checkbox is checked.
for an array of checkboxes with the same name you can get the list of checked ones by
var boxes = $('input[name=thename]:checked');
then to loop through them and see what's checked you can do
$(boxes).each(function(){
//do stuff here with this
});
to find how many are checked you can do
$(boxes).size();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment