真痛苦,暂时只能这样了,如下
<script language="javascript">
function changefocus_onkeyup()
{ //alert("ffdfd"
;
key=window.event.keyCode;
if(key==0xD)//判断是否按下回车键
{
CurTabIndex=event.srcElement.tabIndex+1//将当前tabindex的值加1
for (n=0;n<newinfo_form.elements.length;n++)
{
if (newinfo_form.elements[n].tabIndex==CurTabIndex) //找到下一个表单元素
{
newinfo_form.elements[n].focus();
//移动焦点
return true;
}
}
}
}
</script>
<script language="javascript"
event="onkeydown"
for="document">
if(event.keyCode==13)
event.keyCode=9;
</script>
<form name="newinfo_form"
action="YYY.asp"
method="post"
language="javascript">
<input type=text name="txtName1"
size="16"
tabindex=1>
<input type=text name="txtName2"
size="16"
tabindex=2>
<input type=text name="txtName3"
size="16"
tabindex=3>
<input type=text name="txtName4"
size="16"
tabindex=4>
<input type=checkbox name="chkSign"
tabindex=5>
<input type=submit value="asdf"
tabindex = 6>
</form>
另外参考
http://www.dev-club.com/club/bbs/announce,2483626,1.htm