Reputation: 28741
I have a Gridview having checkbox and textbox column. How to retrieve value of textbox belonging to checked row .
var checkCheckBox = $("#<%=GrdV.ClientID %> [id*=chkOrder]");
$(checkCheckBox).click(function () {
if ($(this).is(':checked')) {
alert($(this).parent("tr").find($("[id *= txtboxQty]")).val());
}
shows
undefined.
Upvotes: 1
Views: 2908
Reputation: 74738
try with this:
alert($(this).closest("tr").find($("[id*=txtboxQty]")).val());
here .closest()
is been used to traverse up to the tr
which is grand parent, because .parent()
returns the parent dom node.
Upvotes: 2