<
html>
<head>
<script language="javascript">
<!--
function focusnext(comp)
{
var i = 0;
if(comp.value.length == comp.maxLength)
{
while (i < 100)
{
if(comp.form.elements[i])
{
alert('tabindex: ' + comp.form.elements[i].tabindex);
if(comp.form.elements[i].tabindex == comp.tabindex + 1)
{
comp.form.elements[i].focus();
break;
}
}
else
{
alert('fehler: kein entsprechendes element gefunden!');
break;
}
i++;
}
}
}
//-->
</script>
</head>
<body>
<form name="form1" method="post" action="">
<input type="text" name="textfield1" onkeypress="focusnext(this);" maxlength="2" tabindex="1">
<input type="text" name="textfield2" onkeypress="focusnext(this);" maxlength="3" tabindex="3">
<input type="text" name="textfield3" onkeypress="focusnext(this);" maxlength="1" tabindex="2">
<input type="text" name="textfield4" onkeypress="focusnext(this);" maxlength="5" tabindex="5">
<input type="text" name="textfield5" onkeypress="focusnext(this);" maxlength="4" tabindex="4">
<input type="button" name="Submit" value="Submit">
</form>
</body>
</
html>