如何写,当输入的文本框的字符达到8个数字的时候,自动提交表单

lbx972 2004-08-24 02:21:35
如题!
...全文
140 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ycted 2004-08-24
  • 打赏
  • 举报
回复
星星们的做法都可以解决问题.
bananasmiling 2004-08-24
  • 打赏
  • 举报
回复
<form name="form1" method="post" action="xxx.asp">
<input type="text" onpropertychange="if (this.value.length==8) this.form.submit();">
</form>
zltostem 2004-08-24
  • 打赏
  • 举报
回复
8个数字 ...
xzq686 2004-08-24
  • 打赏
  • 举报
回复
也可以用问号表达式:
<form name="form1" method="post" action="xxxxxxxx.asp" ID="Form1">
<input type="text" onkeyup="(this.value.length==8) ? form1.submit():1" ID="Text1" NAME="Text1">
</form>
zltostem 2004-08-24
  • 打赏
  • 举报
回复
<script language="vbs">
<!--
function funcheck()
Dim ingc
Dim i
for ingc = 1 To len(Trim(document.all.T1.value))
If IsNumeric(Mid(Trim(document.all.T1.value),1)) Then
i = i +1
If i = 8 Then
form1.submit()
Exit For
End If
End If
End function
-->
</script>

<input name=T1 size=20 onpropertychange="funcheck()">
mjpclab 2004-08-24
  • 打赏
  • 举报
回复
<form name="form1" method="post" action="xxxxxxxx.asp">
<input type="text" onpropertychange="if (this.value.length==8) this.form.submit();">
</form>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧