asp 判断输入的字符串中是否含有字母
<%'判断字符串中是否含有字母function chkChar(str)'先将str转为小写str = LCase(str) flag=false enChar="a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z" onChar=split(enChar,",") for i=0 to ubound(onChar) if instr(str,onChar(i))<>0 then flag=true exit for end if next chkChar=flag end function%>调用的方法
if (chkChar(memo)) thenResponse.Write("<script>alert('您填写的留言内容格式不正确,请认真填写!');history.back();</script>")end if
页:
[1]