| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3085 人关注过本帖
标题:用ASP写注册页面直接提示功能的代码
只看楼主 加入收藏
kidy2005
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2007-4-18
收藏
 问题点数:0 回复次数:7 
用ASP写注册页面直接提示功能的代码

就像http://register.9you.com/regist1.jsp中,当我打开该注册页面的时候用户名输入框后提示:用户名可使用数字、字母,长度为6-12,当我输入汉字的时候直接提示:用户名只可使用数字、字母

而当我输入数字或字母位数少于6位或者位数大于12位的石油直接提示:用户名长度只能为6-12位

以及正则表达式在Javascript脚本中如何应用:

我想将注册页面的用户名限制为6-12的数字或字母,在Javascript脚本中中如何应用\w{6,12}???

有谁可以将代码帖出来让大家分享下!!!

希望能够得到帮助!

搜索更多相关主题的帖子: 提示 石油 ASP 页面 用户名 
2007-05-14 14:07
kobe412
Rank: 1
来 自:网络的另一边
等 级:新手上路
威 望:1
帖 子:322
专家分:0
注 册:2006-6-12
收藏
得分:0 
Case "add"
Name=htmlencode(request.form("Name"))
Qq=htmlencode(request.form("Qq"))
Mail=htmlencode(request.form("Mail"))
Info=htmlencode(request.form("Info"))
If Name="" or Qq="" or Mail="" or Info="" then
Response.Write "<script>alert('姓名、QQ、邮箱、留言必须填写!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Name)>16 then
Response.Write "<script>alert('姓名不要大于16个字符!');this.location.href='Index.asp';</SCRIPT>"
ElseIf not (isNumeric(Qq) or Qq="") then
Response.Write "<script>alert('QQ号码必须为数字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Qq)<5 or len(Qq)>10 then
Response.Write "<script>alert('QQ号不要大于9个数字小于5个数字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf Instr(Mail,".")<=0 or Instr(Mail,"@")<=0 then
Response.Write "<script>alert('邮箱必须包括(@)(.)!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Mail)>30 or len(Mail)<6 then
Response.Write "<script>alert('邮箱请不要大于30个汉字小于6个汉字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Info)>400 then
Response.Write "<script>alert('留言内容不得大于400个字符!');this.location.href='Index.asp';</SCRIPT>"
Else
Set mRs= Server.CreateObject("adodb.recordSet")
mRs.open "Select * from book", conn, 1, 3
mRs.addnew
mRs("Name") = Name
mRs("Mail") = Mail
mRs("Qq") = Qq
mRs("Info") = Info
mRs("time") = now()
mRs.update
mRs.close

仅供参考!!

俺这么帅气的人,俺为了挖矿打光棍俺容易吗?
2007-05-14 14:16
kobe412
Rank: 1
来 自:网络的另一边
等 级:新手上路
威 望:1
帖 子:322
专家分:0
注 册:2006-6-12
收藏
得分:0 
Case "add"
Name=htmlencode(request.form("Name"))
Qq=htmlencode(request.form("Qq"))
Mail=htmlencode(request.form("Mail"))
Info=htmlencode(request.form("Info"))
If Name="" or Qq="" or Mail="" or Info="" then
Response.Write "<script>alert('姓名、QQ、邮箱、留言必须填写!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Name)>16 then
Response.Write "<script>alert('姓名不要大于16个字符!');this.location.href='Index.asp';</SCRIPT>"
ElseIf not (isNumeric(Qq) or Qq="") then
Response.Write "<script>alert('QQ号码必须为数字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Qq)<5 or len(Qq)>10 then
Response.Write "<script>alert('QQ号不要大于9个数字小于5个数字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf Instr(Mail,".")<=0 or Instr(Mail,"@")<=0 then
Response.Write "<script>alert('邮箱必须包括(@)(.)!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Mail)>30 or len(Mail)<6 then
Response.Write "<script>alert('邮箱请不要大于30个汉字小于6个汉字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Info)>400 then
Response.Write "<script>alert('留言内容不得大于400个字符!');this.location.href='Index.asp';</SCRIPT>"
Else
Set mRs= Server.CreateObject("adodb.recordSet")
mRs.open "Select * from book", conn, 1, 3
mRs.addnew
mRs("Name") = Name
mRs("Mail") = Mail
mRs("Qq") = Qq
mRs("Info") = Info
mRs("time") = now()
mRs.update
mRs.close

俺这么帅气的人,俺为了挖矿打光棍俺容易吗?
2007-05-14 14:16
kobe412
Rank: 1
来 自:网络的另一边
等 级:新手上路
威 望:1
帖 子:322
专家分:0
注 册:2006-6-12
收藏
得分:0 
Case "add"
Name=htmlencode(request.form("Name"))
Qq=htmlencode(request.form("Qq"))
Mail=htmlencode(request.form("Mail"))
Info=htmlencode(request.form("Info"))
If Name="" or Qq="" or Mail="" or Info="" then
Response.Write "<script>alert('姓名、QQ、邮箱、留言必须填写!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Name)>16 then
Response.Write "<script>alert('姓名不要大于16个字符!');this.location.href='Index.asp';</SCRIPT>"
ElseIf not (isNumeric(Qq) or Qq="") then
Response.Write "<script>alert('QQ号码必须为数字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Qq)<5 or len(Qq)>10 then
Response.Write "<script>alert('QQ号不要大于9个数字小于5个数字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf Instr(Mail,".")<=0 or Instr(Mail,"@")<=0 then
Response.Write "<script>alert('邮箱必须包括(@)(.)!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Mail)>30 or len(Mail)<6 then
Response.Write "<script>alert('邮箱请不要大于30个汉字小于6个汉字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Info)>400 then
Response.Write "<script>alert('留言内容不得大于400个字符!');this.location.href='Index.asp';</SCRIPT>"
Else
Set mRs= Server.CreateObject("adodb.recordSet")
mRs.open "Select * from book", conn, 1, 3
mRs.addnew
mRs("Name") = Name
mRs("Mail") = Mail
mRs("Qq") = Qq
mRs("Info") = Info
mRs("time") = now()
mRs.update
mRs.close

俺这么帅气的人,俺为了挖矿打光棍俺容易吗?
2007-05-14 14:17
kobe412
Rank: 1
来 自:网络的另一边
等 级:新手上路
威 望:1
帖 子:322
专家分:0
注 册:2006-6-12
收藏
得分:0 
Case "add"
Name=htmlencode(request.form("Name"))
Qq=htmlencode(request.form("Qq"))
Mail=htmlencode(request.form("Mail"))
Info=htmlencode(request.form("Info"))
If Name="" or Qq="" or Mail="" or Info="" then
Response.Write "<script>alert('姓名、QQ、邮箱、留言必须填写!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Name)>16 then
Response.Write "<script>alert('姓名不要大于16个字符!');this.location.href='Index.asp';</SCRIPT>"
ElseIf not (isNumeric(Qq) or Qq="") then
Response.Write "<script>alert('QQ号码必须为数字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Qq)<5 or len(Qq)>10 then
Response.Write "<script>alert('QQ号不要大于9个数字小于5个数字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf Instr(Mail,".")<=0 or Instr(Mail,"@")<=0 then
Response.Write "<script>alert('邮箱必须包括(@)(.)!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Mail)>30 or len(Mail)<6 then
Response.Write "<script>alert('邮箱请不要大于30个汉字小于6个汉字!');this.location.href='Index.asp';</SCRIPT>"
ElseIf len(Info)>400 then
Response.Write "<script>alert('留言内容不得大于400个字符!');this.location.href='Index.asp';</SCRIPT>"
Else
Set mRs= Server.CreateObject("adodb.recordSet")
mRs.open "Select * from book", conn, 1, 3
mRs.addnew
mRs("Name") = Name
mRs("Mail") = Mail
mRs("Qq") = Qq
mRs("Info") = Info
mRs("time") = now()
mRs.update
mRs.close

俺这么帅气的人,俺为了挖矿打光棍俺容易吗?
2007-05-14 15:09
kidy2005
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2007-4-18
收藏
得分:0 

没人会用ASP写注册页面的直接提示功能吗?我相信这里有的是人才,只要你们济点时间出来帮帮我嘛


恒天装饰网:http://www.
2007-05-16 16:06
kidy2005
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2007-4-18
收藏
得分:0 
你这些都是一般的注册页面添加代码啊?有没有那种如楼主说的那种?

恒天装饰网:http://www.
2007-05-20 10:11
lmhllr
Rank: 8Rank: 8
等 级:贵宾
威 望:44
帖 子:1504
专家分:42
注 册:2005-5-12
收藏
得分:0 

LZ是来要代码的还是讨论学习的???

2007-05-20 12:32
快速回复:用ASP写注册页面直接提示功能的代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015908 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved