I have a datagrid on an asp.net page and I need to find the values in embedded <input> text element controls only for a certain column in order to sum these values.
This javascript only gets me down to the <td>'s I need and I can't go any further to get to the <input>'s and get the values. Not all cells in this column have embedded <input> elements.
How can I get the values of the <input> text elements?PHP Code:function GetValues()
{
// get datagrid by rendered table name
var grid = document.getElementById('datagrid1');
var len = grid.rows.length;
// touch each row, retrieve cell 2 innerHTML
for(i = 0; i < len; i++)
{
// show raw text for cells, <input type="text"... > for text box
alert(grid.rows[i].cells[2].innerHTML);
}
}




Reply With Quote