日期:2009-03-29  浏览次数:20919 次

<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--
function T1_onkeyup() {
  if(document.card.T1.value.length==4){
     document.card.T2.focus();
   }
}
function T2_onkeyup() {
  if(document.card.T2.value.length==4){
     document.card.T3.focus();
   }
}

function T3_onkeyup() {
  if(document.card.T3.value.length==4){
     document.card.T4.focus();
   }
}
//-->
</script>

在<body>...</body>之间加入如下代码:
<form method="POST" name="card" action>
输入字符:
<input type="text" name="T1" size="4" maxlength="4" LANGUAGE="javascript" onkeypress="return T1_onkeyup()">-

<input type="text" name="T2" size="4" maxlength="4" LANGUAGE="javascript" onkeypress="return T2_onkeyup()">-

<input type="text" name="T3" size="4" maxlength="4" LANGUAGE="javascript" onkeypress="return T3_onkeyup()">-

<input type="text" name="T4" size="4" maxlength="4">
</form>