讓焦點(diǎn)自動(dòng)跳轉(zhuǎn)
更新時(shí)間:2006年07月01日 00:00:00 作者:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>html-www.51windows.Net</title>
</head>
<body>
以下四個(gè)文本框,每個(gè)限輸入四個(gè)字符,輸入完后自動(dòng)跳到下一文本框
<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>
<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>
</body>
</html>
<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代碼" onClick= 'window.location = "view-source:" + window.location.href'></div>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>html-www.51windows.Net</title>
</head>
<body>
以下四個(gè)文本框,每個(gè)限輸入四個(gè)字符,輸入完后自動(dòng)跳到下一文本框
<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>
<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>
</body>
</html>
<div style="position: absolute; top: 10; right: 10; width: 148; height: 18;cursor:hand">
<input type="button" name="Button" value="查看源代碼" onClick= 'window.location = "view-source:" + window.location.href'></div>
相關(guān)文章
textarea的value是html文件源代碼,存成html文件的代碼
textarea的value是html文件源代碼,存成html文件的代碼...2007-04-04在textarea中顯示html頁(yè)面的javascript代碼
在textarea中顯示html頁(yè)面的javascript代碼...2007-04-04(僅IE下有效)關(guān)于checkbox 三態(tài)
(僅IE下有效)關(guān)于checkbox 三態(tài)...2007-05-05用JavaScript實(shí)現(xiàn)的一個(gè)IP地址輸入框
用JavaScript實(shí)現(xiàn)的一個(gè)IP地址輸入框...2007-10-10js 獲取中文拼音,Select自動(dòng)匹配字母獲取值的代碼
漢字轉(zhuǎn)拼音,拼音首字母,select選擇按聲母過(guò)濾2009-09-09