注册 登录
编程论坛 ASP技术论坛

如何限止字数

mai_25 发布于 2007-11-30 20:04, 1035 次点击
如何限止字数?
6 回复
#2
madpbpl2007-11-30 20:41
left 或mid函数
#3
xiaobai405102007-12-02 07:56
用属性:maxlength应该可以了!
#4
multiple19022007-12-02 09:47
不晓得限制谁的字数。语文没学好吧?
#5
guohan2007-12-03 12:32
回复 1# 的帖子
利用正则表达式
#6
中国男孩2007-12-03 14:56
回复 1# 的帖子
可以用VBscrtip
如:
function add_onsubnit()
    if len(trim(window.document.form.add.name.value))<2 then
    window.alert("不能小于两个字符")
    add_onsubmit=false
    exit function
end if
end function
#7
yms1232007-12-03 16:14
VBScript中用Len函数求得字符串的字数。
比如:Len("Abcdeft")
Javascript中用字符串的lenght属性来获得字数。
比如:"abcdefg".length;
1