Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using JQuery to sum textbox in GridView

Status
Not open for further replies.

tshad

Programmer
Jul 15, 2004
386
0
0
US
I have a GridView that has 2 textboxes. I need to sum each column and put the value in another label.

At the moment I am just trying to sum the column and can't seem to get it to work.

I have:
Code:
$(function () {
    var checkBoxSelector = '#<%=mGridView.ClientID%> input[id*="txtOrderQty"]';

    $(checkBoxSelector).blur(function () {
        $('#<%=mGridView.ClientID%> tr').each(function () {
            if($(this).find('contains("txtOrderQty")'))
            alert("");
        });
    });
});

This does fine with the blur, so if I change the value in the txtOrderQty textbox, it goes and starts looping through the rows in the Grid.

That seems to work fine.

but I can't seem to figure out how to get the value from each textbox.

How would I change the "if" statement to get the value.

Thanks,

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top