Click here to Skip to main content
15,742,655 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have a scenario where i need to check the row values before hitting the dB to store those values,the issue arises when I try to fetch the value of the row specific column. Now suppose, if i have a text box in the grid and then I click on Edit that makes a particular row open for edit on click of submit/ok button I need to retrieve the latest value of the Textbox but the javascript fetches the previous value.

The following is the Javascript/jquery used

function GetSelectedRow(lnk) {
       var row = lnk.parentNode.parentNode;
       var rowIndex = row.rowIndex - 1;
       var customerId = row.cells[0].innerHTML;
       var city = row.cells[1].getElementsByTagName("input")[0].value;
       alert("RowIndex: " + rowIndex + " CustomerId: " + customerId + " City:" + city);
       return false;

Any help................
Updated 18-Apr-14 7:33am
I guess this is a Page Load issue. Can you should the Page Load code and how you bind the GridView.
SwarupDChavan 18-Apr-14 9:25am    
actually i want to retrieve the values that I insert into the TextBox when I update and I need to do it at the client side using jquery
Ok, but why are you getting previous values? Post more codes.
j snooze 18-Apr-14 17:30pm    
Can you add an onblur event to the textbox in question setting the innerHTML of the cell you want.
<intput type="text" önblur="UpdateChanges(this);/">

function UpdateChanges(textbox){
row.cells[0].innerHTML = textbox.value;

Didn't try this, but it might work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900