<html>
<head>
<script>
function check(obj) {
if (obj.value.length == 4) {
var next = obj.nextSibling;
while(next.nodeType != 1 && next.nextSibling)
next = next.nextSibling;
if (next.nodeType == 1)
next.focus();
}
}
</script>
</head>
<body>
<input type="text" size="4" maxlength="4" onkeyup="check(this);" /> -
<input type="text" size="4" maxlength="4" onkeyup="check(this);" /> -
<input type="text" size="4" maxlength="4" onkeyup="check(this);" /> -
<input type="text" size="4" maxlength="4" onkeyup="check(this);" />
</body>
</html>