I am trying to get the following to work in a timesheet page:
Code:
document.onkeypress = keyHit;
function keyHit(evt) {
var e = evt || window.event;
if (document.timeform.DeBugging.checked==false) {
  j=1;
  return true; }
if (e.keyCode == 40) {
  if ( j < 79)
     j+=8; 
  document.timeform.elements[j].focus(); }
if (e.keyCode == 38) {
  if ( j > 7)
     j-=8; 
  document.timeform.elements[j].focus(); }  	 
	
if (e.keyCode == 13) {
  if (j == 0) {   // Override of date
    datePopulate(); }
  else {
    var jmod = j%8;
    if (jmod == 2 || jmod == 5) {
      calculate();
    j = (jmod == 2)? j+1 : j+3; } }
  document.timeform.elements[++j].focus();  
}
return true;
}
but it only works in Firefox. My inspiration from a sudoku solver looks like this, but it does work in Internet Explorer.
Code:
function gridKey(oInput, evt)
{
	var e = evt ? evt : window.event;
	// check for arrow key
	
	var dx = 0; 
	var dy = 0;
	
	switch ( e.keyCode )
	{
		case 37: dx--; break; // left arrow
		case 38: dy--; break; // up arrow
		case 39: dx++; break; // right arrow
		case 40: dy++; break; // down arrow
		case 13: dy++, dx=100; break; // return key
		default: return;
	}
	var sID = oInput.id.substring(7);
	var a = sID.split('_');
	var y = parseInt(a[0]);
	var x = parseInt(a[1]);
	
	if (dx == 100) x = 0; else x += dx;
	y += dy;
	var oInput2 = document.getElementById('sudoku_' + y + '_' + x);
	if ( oInput2 ) oInput2.focus();
}
SudokuPuzzle.prototype.displayInputCell = function(i,j)
{
	var value = this.grid[i][j];
	if ( value == ' ' ) value = '';

	var id = 'sudoku_' + i + '_' + j;
	return '<input style="width:30px" id="' + id + 
			'" value="' + value + 
			'" onkeydown="gridKey(this,event);">';
}
The full pages are timesheet.htm and sudoku.htm respectively.

TIA