Hi,
I have one html form and I want to move cursor to another field to a different tabindex order using TAB key. I wrote a function “moveto()”, and it is called on field EMAIL on event Onkeydown, the cursor should move to field ‘realname’, but it doesn’t work.
Dose anyone know how it can be fixed?
<html>
<head>
<script type=”text/javascript”>
function moveto(){
document.forms[0].elements[‘realname’].focus()
}
</script>
</head>
<body>
<FORM ACTION=”” METHOD=POST>
<TABLE BORDER CELLPADDING=3 CELLSPACING=5 BGCOLOR=”#FFFFCC”>
<TR>
<TD>name: <INPUT NAME=”realname” TABINDEX=1></TD>
<TD ROWSPAN=4>comments<BR>
<TEXTAREA COLS=25 ROWS=5 TABINDEX=4></TEXTAREA></TD></TR>
<TR> <TD>email: <INPUT NAME=”email” TABINDEX=3 onkeydown=”moveto()”></TD></TR>
<TR> <TD>department: <SELECT NAME=”dep” TABINDEX=5>
<OPTION VALUE=””>…
<OPTION VALUE=”prd”>Production</SELECT></TD></TR>
</TABLE>
</FORM>
</body>
</html>
Thanks,
Subrat