关于键盘方法 of course!可以捕捉键盘事件:比如捕捉回车键if(window.event.keyCode==13) documnet.form1.text1.focus();ok,over!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 呵呵,也可以这样function checklength(){if (你要查的文本框名.value.length > 最大个数) 目标文本框.focus();setTimeout("checklength()",100);} 楼上的老兄,请教一个别的问题哈,类似F1,CTRL这样的键用event要怎么捕捉呢? <form method="POST" action="--WEBBOT-SELF--" name="thisform"> <script language="JavaScript"> function chklen() if T1.value.length>4 T2.focus(); end function </script> <p><input type="text" name="T1" size="20" maxlength=5 onfocus="chklen()"></p> <p><input type="text" name="T2" size="20"></p> <p><input type="text" name="T3" size="20"></p> <p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p></form>为什么总是提示缺少对象????????? function chklen(){ if (T1.value.length>4) T2.focus(); } <html><head><script language="JavaScript"> function chklen(){ if (document.thisform.T1.value.length>4) document.thisform.T2.focus(); } </script></head><body><form method="POST" action="--WEBBOT-SELF--" name="thisform"> <p><input type="text" name="T1" size="20" maxlength=5 onKeyDown="chklen()"></p> <p><input type="text" name="T2" size="20"></p> <p><input type="text" name="T3" size="20"></p> <p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p></form></body></html> 十分感谢楼上的,但我发现输完的文本框内容没法修改了!请问该如何才能修改呢?另外,请问哪有详细介绍javascript对象、方法的书下载? <html><head><script language="JavaScript"> function chklen(){ if (document.thisform.T1.value.length>=4 ) document.thisform.T2.focus();} </script></head><body><form method="POST" action="--WEBBOT-SELF--" name="thisform"> <p><input type="text" name="T1" size="20" maxlength=5 onKeyUp="chklen()"></p> <p><input type="text" name="T2" size="20"></p> <p><input type="text" name="T3" size="20"></p> <p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p></form></body></html>try it again! http://developer.netscape.com/docs/manuals/communicator/jsguide4/index.htm?content=sec.htm可以看看. extjs 如何判断checkbox的选中和取值?? 怎么在后台获得动态增加的控件的个数啊? 如何根据文本框动态列出下拉列表 这样为什麽有问题?谢谢 求一段js,用来判断列表中,假如没有选中前面的checkbox的,点击删除无效! 隐藏表格行的问题 如何在正则表达式里匹配 [ 或 ]等特殊字符? 用asp程序打开一个动态 页面,有vbs,总是 提示行2,字符 1 缺少语句 是为什么呀 如何在框架间传递请求? 怎么样才能不出现提示窗口(有关关闭窗口类的)?? script问题请教 这个问题相信对你们各位大侠,很简单.可是对我有点难度.
{
if (你要查的文本框名.value.length > 最大个数) 目标文本框.focus();
setTimeout("checklength()",100);
}
<script language="JavaScript">
function chklen()
if T1.value.length>4 T2.focus();
end function
</script>
<p><input type="text" name="T1" size="20" maxlength=5 onfocus="chklen()"></p>
<p><input type="text" name="T2" size="20"></p>
<p><input type="text" name="T3" size="20"></p>
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
</form>
为什么总是提示缺少对象?????????
if (T1.value.length>4) T2.focus();
}
<head>
<script language="JavaScript">
function chklen(){
if (document.thisform.T1.value.length>4) document.thisform.T2.focus();
}
</script>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--" name="thisform">
<p><input type="text" name="T1" size="20" maxlength=5 onKeyDown="chklen()"></p>
<p><input type="text" name="T2" size="20"></p>
<p><input type="text" name="T3" size="20"></p>
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
</form>
</body>
</html>
<head>
<script language="JavaScript">
function chklen(){
if (document.thisform.T1.value.length>=4 ) document.thisform.T2.focus();
}
</script>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--" name="thisform">
<p><input type="text" name="T1" size="20" maxlength=5 onKeyUp="chklen()"></p>
<p><input type="text" name="T2" size="20"></p>
<p><input type="text" name="T3" size="20"></p>
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
</form>
</body>
</html>
try it again!