1

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.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.