How to count CheckBoxList checked using Jquery
Asked Answered
G

1

5

I have search with the following keyword but couldn't find.

javascript CheckBoxList api

jquery CheckBoxList checked count

Greerson answered 13/6, 2011 at 10:31 Comment(0)
R
8

The following should give you the total number of checked checkboxes on the page

var count = $(':checkbox:checked').length;

If you want to restrict it only to a given CheckBoxList you could assign this checkboxlist some class and then:

var count = $('.someClass :checkbox:checked').length;
Rakeoff answered 13/6, 2011 at 10:33 Comment(1)
Thanks Darin! I was trying to go about it in a for loop and return false for no post back, but this is perfect.Collaborate

© 2022 - 2024 — McMap. All rights reserved.