[Object HtmlinputElement] this error is flagged when i reach here
var row = document.getElementById("<%=gvCustomers.ClientID%>").rows[rowIndex + 2];
<script type="text/javascript">
function enter(obj) {
var tr = obj.parentNode.parentNode;
var cellIndex = obj.parentNode.cellIndex;
var rowIndex = obj.parentNode.parentNode.rowIndex;
if (event.keyCode == 37) //Left
{
if (cellIndex > 0)
tr.parentNode.rows[rowIndex].cells[cellIndex - 1].getElementsByTagName('INPUT')[0].focus();
return;
}
if (event.keyCode == 38) //Up
{
if (rowIndex > 1)
tr.parentNode.rows[rowIndex - 1].cells[cellIndex].getElementsByTagName('INPUT')[0].focus();
return;
}
if (event.keyCode == 39) //Right
{
if (cellIndex < tr.cells.length - 1)
tr.parentNode.rows[rowIndex].cells[cellIndex + 1].getElementsByTagName('INPUT')[0].focus();
return;
}
if (event.keyCode == 40) //Down
{
if (rowIndex < tr.parentNode.rows.length - 1)
tr.parentNode.rows[rowIndex + 1].cells[cellIndex].getElementsByTagName('INPUT')[0].focus();
return;
}
};
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
// enter(obj);
var rowIndex = document.getElementById("<%=hfRowIndex.ClientID%>").value;
alert(rowIndex);
var row = document.getElementById("<%=gvCustomers.ClientID%>").rows[rowIndex + 2];
alert(row);
if (typeof (row) != "undefined") {
var celIndex = parseInt(document.getElementById("<%=hfCellIndex.ClientID%>").value);
var controls = row.cells[celIndex].getElementsByTagName("INPUT");
for (var i = 0; i < controls.length; i++) {
if (controls[i].id.indexOf("txtCountry") || controls[i].id.indexOf("txtName") != -1) {
// Focus to the next record.
controls[i].focus();
break;
}
}
}
}
});
};
</script>