Hola
O algo mas sencillo
Código Javascript
:
Ver original<html>
<head>
<script type="text/javascript">
function tabular(evt, obj, tam) {
tecla=(evt) ? evt.keyCode : evt.charCode;
if(tecla==8) { return; }
var frm=obj.form;
var largo = obj.value.length;
if (largo == tam) {
for(i=0;i<frm.elements.length;i++) {
if(frm.elements[i]==obj) {
if (i==frm.elements.length-1) { i=-1; }
break;
}
}
frm.elements[i+1].focus();
return false;
}
}
</script>
</head>
<body>
<form>
<input type="text" maxlength="2" onkeypress="return tabular(event, this, this.maxLength)" />
<input type="text" maxlength="2" onkeypress="return tabular(event, this, this.maxLength)" />
<input type="text" maxlength="3" onkeypress="return tabular(event, this, this.maxLength)" />
<input type="text" maxlength="4" onkeypress="return tabular(event, this, this.maxLength)" />
</form>
</body>
</html>
Suerte