<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;
}
};
</script>
i wanted to add it to this but it is not working please help
if (event.keyCode == 37) //Left
{
if (cellIndex > 0)
tr.parentNode.rows[rowIndex].cells[cellIndex - 1].getElementsByTagName('INPUT')[0].focus();
$(this).closest("tr").find('[id*=chkRow]').attr('checked', 'checked');
return;
}