首页 > Web开发 > 详细

asp数据校验

时间:2018-06-08 13:26:31      阅读:183      评论:0      收藏:0      [点我收藏+]

<%

if trim(request("action"))="add" then

if request.form("cn_name1")=Empty or request.Form("pwd")=Empty or request.Form("pwd2")=Empty or request.Form("class")=Empty   then

response.Write("<script language=javascript>" & chr(13) & "alert(‘错误:请将信息输入完整!带*项必须填写!‘);" & "javascript:history.go(-1)" & "</script>")

elseif request.form("pwd") <> request.form("pwd2") then

response.write("<script language=‘javascript‘> alert(‘错误:密码与确认密码不符!‘); javascript:history.go(-1) </script>")

elseif len(request.form("cn_name1"))>16 then

response.write("<script language=‘javascript‘> alert(‘错误:用户名长度超过16个字符,10个汉字‘); javascript:history.go(-1) </script>")

elseif len(request.form("cn_name1"))<4 then

response.write("<script language=‘javascript‘> alert(‘错误:用户名长度少于4个字符,2个汉字‘); javascript:history.go(-1) </script>")

elseif len(request.form("class"))<2 then

response.write("<script language=‘javascript‘> alert(‘错误:班级名称少于4个字符!‘); javascript:history.go(-1) </script>")

elseif len(request.form("pwd"))>20 or len(request.form("pwd"))<6 then

response.write("<script language=‘javascript‘> alert(‘错误:你输入的密码长度不符合!‘); javascript:history.go(-1) </script>")

end if

end if

%>

asp数据校验

原文:https://www.cnblogs.com/ince/p/9154754.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!