如何限定死一个文本框只能输入4个字符????急啊!

lio_sy 2003-10-15 11:27:28
<input type="text" name="year" size="4" > 年
==================================================
这个不行,他还是可以输入很多啊,只不过滚到后面去了
...全文
222 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
legendxia 2003-10-15
  • 打赏
  • 举报
回复
up
dx 2003-10-15
  • 打赏
  • 举报
回复
楼上的都讲完了

完全同意
007james 2003-10-15
  • 打赏
  • 举报
回复
<input type="text" name="year" maxlength=4> 年
就ok了
yangsm 2003-10-15
  • 打赏
  • 举报
回复
也就是一楼的<input type="text" name="year" size="4" maxlength=4> 了。
allfirst 2003-10-15
  • 打赏
  • 举报
回复
maxlength=4
61 2003-10-15
  • 打赏
  • 举报
回复
用maxlength属性
Jaron 2003-10-15
  • 打赏
  • 举报
回复
<input type="text" name="year" size="4" maxlength=4> 年
eliphe 2003-10-15
  • 打赏
  • 举报
回复
<input type="text" name="year" size="4" maxlength=4> 年

28,390

社区成员

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

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