为何不出现警告框呢?
大家看看以下的简单程序,为何我已经做了判断,但表单为空时提交,为何没有出现我想要的警告框呢?我把编写判断的那几句列出来,请大家帮忙看看,行不?
<!--#include file="conn02.asp"-->
<%
if request.form("xhname")="" then
response.write"<SCRIPT language=JavaScript>alert('学号不能为空!');"
response.write"javascript:history.go(-1)</SCRIPT>"
end if
if request.form("xmname")="" then
response.write"<SCRIPT language=JavaScript>alert('姓名不能为空!');"
response.write"javascript:history.go(-1)</SCRIPT>"
end if
xh=trim(request.form("xhname"))
xm=trim(request.form("xmname"))
set rs=server.createobject("adodb.recordset")
sql="select * from cjcx where 学号='"&xh&"' and 姓名='"&xm&"'"
rs.open sql,conn,1,1
%>
<!--#include file="conn02.asp"-->
<%
if request.form("xhname")="" then
response.write"<SCRIPT language=JavaScript>alert('学号不能为空!');"
response.write"javascript:history.go(-1)</SCRIPT>"
end if
if request.form("xmname")="" then
response.write"<SCRIPT language=JavaScript>alert('姓名不能为空!');"
response.write"javascript:history.go(-1)</SCRIPT>"
end if
xh=trim(request.form("xhname"))
xm=trim(request.form("xmname"))
set rs=server.createobject("adodb.recordset")
sql="select * from cjcx where 学号='"&xh&"' and 姓名='"&xm&"'"
rs.open sql,conn,1,1
%>
...全文
相关推荐
不刷新网页就能链接新的js文件方法总结
如何不刷新网页就能链接新的js文件,其实在HTML语言中已经有相关的函数了,就是再添加一个[removed][removed]。 函数很简单,叫document.body.appendChild(script); 使用方法如下 <!DOCTYPE html><html><head><meta charset="utf-8"> [removed] function myFunction(){ var script = document.createElement("script"); script.src = "cs.j
javascript 跳转代码集合
网页页面客户端脚本跳转实现代码。一般后台语言多需要输出一些js跟前台的结合。
jquery——tipswindown弹出层插件
jquery——tipswindown弹出层插件,对应博文:http://blog.csdn.net/shellwin/archive/2010/07/31/5778578.aspx
jquery 弹出层效果
jQuery 警报对话框的(“警报”,确认,提示更换) 多种多样的 弹层提示 自定义的警告框
不使用ajax实现无刷新提交表单
主要介绍了不使用ajax实现无刷新提交表单的方法,需要的朋友可以参考下



