Created
September 8, 2013 15:07
-
-
Save rajvanshipradeep15/6485441 to your computer and use it in GitHub Desktop.
php checkboxes code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#' + 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