Reputation: 961
I have a Gridview, each row with two check box, on the check of second checkbox i want the first check box to be checked automatically.I'm looking for Clent side scripts...Please help
Upvotes: 0
Views: 246
Reputation: 1563
Try this
var rows = $("#your table tr:gt(0)"); // skip the header row
rows.each(function(index) {
var lastCheckbox = $("td:nth-child(youlast checkbox cell) input", this);
var firstCheckBox=$("td:nth-child(firstCheckboxCellIndex) input", this);
$(lastCheckbox).change(function(e) { $(firstCheckBox).attr('checked',$(this).is(':checked'));
});;
Upvotes: 1