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

在asp中制作留言板,如何判断多个文本框为空??

CYCcaoyanchu 发布于 2012-07-11 09:55, 532 次点击
<%
         if request.Form("contenttop")="" or request.Form("content")="" then
             Response.Write("<script>alert('留言标题或留言内容不能为空!');history.back(-1);</script>")
            Response.End()
         if request.Form("QQ")="" or request.Form("fromwhere")="" then
             Response.Write("<script>alert('如需本园联系您,请您留下您的联系方式!');</script>")
            Response.End()

            End if
            name=request.Form("name")   '读取表单元素
            Email=request.Form("email")
            fromwhere=request.Form("fromwhere")
            QQ=request.Form("qq")
            contenttop=request.Form("contenttop")
            content=request.Form("content")
            
        
            exec="insert into yhly(name,Email,fromwhere,qq,contenttop,content) values('"+name+"','"+Email+"','"+formwhere+"','"+QQ+"','"+contenttop+"','"+content+"')"   
            conn.execute exec
            conn.close
            set conn=nothing
            Response.Write("<script>alert('留言添加成功!!');</script>")
        %>
我只要加上红色那段代码,就会报错,请教各位大侠怎么回事呢???
0 回复
1