Hi, Please let me know how to check if any checkbox is checked in a specific column (for example first column) of the GridView control using jQuery? there are checkboxes in other columns too, but I need to check if any checkbox is checked in a specific column. thanks in advance.
views:
31answers:
2
+1
A:
You could do this:
var checked = $('selectorForColumn :checkbox:checked').length > 0;
or this:
var checked = $('selectorForColumn :checkbox').is(':checked');
...which will return true
if at least one checkbox in the column is checked.
Not sure what the proper selector is without seeing your markup, but if it is the first column, you would do something like this:
$('table > tbody > tr > td:first-child :checkbox')
patrick dw
2010-08-27 17:45:48
A:
thanks for the reply. solved it myself with help from the following link
if ($("#<%=GridView1.ClientID %> >tbody >tr >td:first-child > input[type=checkbox]:checked").length > 0) {}
RKP
2010-08-27 17:50:38
Yeah, that's the same as my first solution.
patrick dw
2010-08-27 17:54:24