This function can set the next input text field focused:
function SetNextCellFocus(source) {
var lastFocusCellName = source.name;
var els = document.getElementsByTagName("INPUT");
var lLength = els.length;
for (var i = 0; i < lLength; i++) {
if (els[i].name != null) {
if (els[i].name == lastFocusCellName && i + 1 < lLength) {
try {
els[i + 1].focus();
els[i + 1].select();
}
catch (err) { }
finally {
break;
}
}
}
}
}