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

请求高手指点下,ASP中len()问题

xzalabc 发布于 2011-12-06 16:09, 408 次点击
<%
T3=Request.form("T3")
if len(T3)<>10  then
response.write "<script language=javascript>alert('号码不为10位数);history.go(-1);</script>"
end if
if len(T3)="" then
response.write "<script language=javascript>alert('号码不能为空');history.go(-1);</script>"
end if
  %>
T3返回的号码为1234567890  ,这个是10个数字啊怎么还是提示“号码不为10位数字啊”

帮我看下程序哪儿有问题
2 回复
#2
xzalabc2011-12-06 16:24
帮忙看下啊,拜托了
#3
gesongs2011-12-06 18:19
<%
T3=Request.form("T3")
if len(trim(T3))<>10  then
response.write "<script language=javascript>alert('号码不为10位数);history.go(-1);</script>"
end if
if trim(len(T3))&"x"="x" then
response.write "<script language=javascript>alert('号码不能为空');history.go(-1);</script>"
end if
  %>
试试!

[ 本帖最后由 gesongs 于 2011-12-6 18:20 编辑 ]
1