Puoi fare cosi (non testato)
codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript" type="text/javascript">
<!--
function next(anInputText) {
if (anInputText.value.length == anInputText.maxLength) {
oCol = document.getElementsByTagName('INPUT');
a = oCol.length;
for (i=0;i<a;i++) {
current = oCol[i];
if (current.type == 'text' && current.tabIndex == anInputText.tabIndex + 1) {
current.focus();
return;
}
}
}
}
//-->
</script>
</head>
<body>
<input type="text" maxlength="5" tabindex="1" onkeypress="next(this)">
<input type="text" maxlength="5" tabindex="2" onkeypress="next(this)">
<input type="text" maxlength="5" tabindex="3" onkeypress="next(this)">
<input type="text" maxlength="5" tabindex="4" onkeypress="next(this)">
<input type="text" maxlength="5" tabindex="5" onkeypress="next(this)">
</body>
</html>