标题:验证姓名是否正确
取消只看楼主
gswycjc
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2011-5-1
结帖率:66.67%
已结贴  问题点数:16 回复次数:3 
验证姓名是否正确
我想将下面代码改成如果所填姓名不等于先前网页上的赋值a(注:a=rs("brlword")),则提示“姓名不对!”。请高手支招:
  if (document.form.stuname.value == "")        
  {        
    alert("姓名不能为空!");        
    document.form.stuname.focus();        
    return false;        
  }
搜索更多相关主题的帖子: 姓名 return false 网页 
2012-04-10 08:00
gswycjc
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2011-5-1
得分:0 
感谢2楼。这里的语法我明白了,可是我发现先前对a的赋值不对,怎样才能在其他网页上将rs("brlword")赋值给a,然后在这里调用呢?请再指导!
2012-04-11 10:32
gswycjc
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2011-5-1
得分:0 
下面这段代码中,我想将rs("brlword")的值赋值给a,以备在其他网页中调用a的值(用户姓名),可是按下面两处红色处做了调用不到啊,请高手予以指导。

if founderr=true then
call error()
else
    select case rs("bclass")'1正式用户 |0待审核 |2被锁定 |3版主
    case 1
        session("memberusername")=username
        Response.Cookies("soonhostmember")("username") = username
        Response.Cookies("soonhostmember")("password") = password
        response.cookies("soonhostmember")("auid")=rs("id")
        response.cookies("soonhostmember")("sex")=rs("bsex")
        response.cookies("soonhostmember")("mail")=rs("bmail")
        response.cookies("soonhostmember")("url")=rs("burl")
        response.cookies("soonhostmember")("taketime")=rs("btime")
        if rs("boicq")<>"" then
        response.cookies("soonhostmember")("oicq")=rs("boicq")
        end if
        response.cookies("soonhostmember")("face")=rs("bface")
        response.cookies("soonhostmember")("public")=savecookie
        response.cookies("soonhostmember")("class")=1
            if savecookie=1 then
                response.Cookies("soonhostmember").Expires=Date+365
            end if
a=rs("brlword")
        response.redirect"successed.asp"
    case 0   
            response.Cookies("soonhostmember")=now()
            errmsg=errmsg+"<br>"+"<li>正在等待管理员审核!您现在还不能登陆"
            call error()
            response.end
    case 2
        response.Cookies("soonhostmember")=now()
        errmsg=errmsg+"<br>"+"<li>您已经被管理员锁定,请联系管理员"
            call error()
            response.end
    case 3
        session("memberusername")=username
        Response.Cookies("soonhostmember")("username") = username
        Response.Cookies("soonhostmember")("password") = password
        response.cookies("soonhostmember")("auid")=rs("id")
        response.cookies("soonhostmember")("sex")=rs("bsex")
        response.cookies("soonhostmember")("mail")=rs("bmail")
        response.cookies("soonhostmember")("url")=rs("burl")
        response.cookies("soonhostmember")("taketime")=rs("btime")
        response.cookies("soonhostmember")("oicq")=rs("boicq")
        'response.cookies("soonhostmember")("face")=rs("bface")
        response.cookies("soonhostmember")("public")=savecookie
        response.cookies("soonhostmember")("class")=3
        session("membersoonhost")="passed"
            if savecookie=1 then
                response.Cookies("soonhostmember").Expires=Date+365
            end if
a=rs("brlword")
        response.redirect"successed.asp"        
    end select
end if
2012-04-11 11:24
gswycjc
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2011-5-1
得分:0 
上面这段代码是在进入另一网页时用户输入姓名后进行正确与否检验的
2012-04-11 17:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-365485-1-1.html




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

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