I am developing jquery based application. I have one asp.net gridview with checkboxes in every row. I want to check if any of the checkboxes checked or not. I am looping through gridview rows and checking any checkbox is checked or not as below.
var ResultArrayFirst = [];
$('#<%= gdvRegretletter.ClientID %> input[type="hidden"]').each(function () {
if ($(this).closest('tr').find('input[type="checkbox"]').prop('checked', true))
{
ResultArrayFirst.push($(this).val());
}
});
alert(ResultArrayFirst);
My above code does not works. As soon as above code is executed, all checkboxes will check. I am not sure what i Am missing here. Any help would be appreciated. Thank you.