makumbi says:
<
script
type
=
"text/javascript"
>
function enter(obj) {
var tr = obj.parentNode.parentNode;
if (event.keyCode == 40) //Down
{
if (tr.rowIndex <
tr.parentNode.rows.length
- 1)
tr.parentNode.rows[tr.rowIndex + 1].cells[obj.parentNode.cellIndex].children[0].focus();
return;
}
if (event.keyCode == 37) //Left
{
if (obj.parentNode.cellIndex > 0)
tr.parentNode.rows[tr.rowIndex].cells[obj.parentNode.cellIndex - 1].children[0].focus();
return;
}
if (event.keyCode == 39) //Right
{
if (obj.parentNode.cellIndex <
tr.cells.length
- 1)
tr.parentNode.rows[tr.rowIndex].cells[obj.parentNode.cellIndex + 1].children[0].focus();
return;
}
if (event.keyCode == 38) //Up
{
if (tr.rowIndex > 1)
tr.parentNode.rows[tr.rowIndex - 1].cells[obj.parentNode.cellIndex].children[0].focus();
return;
}
}
</
script
>
Please replace above JavaScript code with below modified code.
<script type="text/javascript">
function enter(obj) {
var tr = obj.parentNode.parentNode.parentNode;
var cellIndex = obj.parentNode.parentNode.cellIndex;
if (event.keyCode == 37) //Left
{
if (cellIndex > 0)
tr.parentNode.rows[tr.rowIndex].cells[cellIndex - 1].children[0].focus();
return;
}
if (event.keyCode == 38) //Up
{
if (tr.rowIndex > 1)
tr.parentNode.rows[tr.rowIndex - 1].cells[cellIndex].children[0].focus();
return;
}
if (event.keyCode == 39) //Right
{
if (cellIndex < tr.cells.length - 1)
tr.parentNode.rows[tr.rowIndex].cells[cellIndex + 1].children[0].focus();
return;
}
if (event.keyCode == 40) //Down
{
if (tr.rowIndex < tr.parentNode.rows.length - 1)
tr.parentNode.rows[tr.rowIndex + 1].cells[cellIndex].children[0].focus();
return;
}
}
</script>