Finding and counting number of checked boxes using JQuery
html, jquery
Solution
var q = $('form#id-of-form').find('input:checked').length;
http://api.jquery.com/checked-selector/
If there are checkboxes in the form you don't want counted, then add a class to the ones you do want counted and select those instead:
var q = $('form#id-of-form').find('input.count-these:checked').length;
Problem
I have one form on a page and within that form there will be a check box for every row in the table. I need to count the number of rows that have a checked row, but I am having trouble even selecting that from jQuery. Here is what my code looks like for a checkbox: ``` <input type="checkbox" id="onHomePage_56" name="onHomePage" value="56" checked="checked"> ``` An unchecked box doesn't have checked="checked".