以下四个文本框,每个限输入四个字符,输入完后自动跳到下一文本框: 输入字符: - - - 在<head>...</head>之间加入如下代码: <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" onkeyup="return T1_onkeyup()">-
<input type="text" name="T2" size="4" maxlength="4" LANGUAGE="javascript" onkeyup="return T2_onkeyup()">-
<input type="text" name="T3" size="4" maxlength="4" LANGUAGE="javascript" onkeyup="return T3_onkeyup()">-
<input type="text" name="T4" size="4" maxlength="4"> </form>
|