<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();
}
if (event.keyCode == 38) //Up
{
if (rowIndex > 1)
tr.parentNode.rows[rowIndex - 1].cells[cellIndex].getElementsByTagName('INPUT')[0].focus();
}
if (event.keyCode == 39) //Right
{
if (cellIndex < tr.cells.length - 1)
tr.parentNode.rows[rowIndex].cells[cellIndex + 1].getElementsByTagName('INPUT')[0].focus();
}
if (event.keyCode == 40) //Down
{
if (rowIndex < tr.parentNode.rows.length - 1)
tr.parentNode.rows[rowIndex + 1].cells[cellIndex].getElementsByTagName('INPUT')[0].focus();
}
};
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
var rowIndex = parseInt(document.getElementById("ContentPlaceHolder1_hfRowIndex").value);
var row = document.getElementById("TeachersCommentsGrd").rows[rowIndex + 1];
if (typeof (row) != "undefined") {
var celIndex = parseInt(document.getElementById("hfCellIndex").value);
var checkbox = row.cells[0].getElementsByTagName("INPUT");
if (!checkbox[0].checked) {
checkbox[0].checked = true;
}
var controls = row.cells[celIndex].getElementsByTagName("INPUT");
for (var i = 0; i < controls.length; i++) {
switch (controls[i].className) {
case "TeacherComments":
controls[i].focus();
return;
default:
}
}
}
}
});
}
</script>
Error when i reach here
var row = document.getElementById("TeachersCommentsGrd").rows[rowIndex + 1];
and also another error when i reach here
var celIndex = parseInt(document.getElementById("hfCellIndex").value);