日期:2014-05-17  浏览次数:20853 次

单击检测按钮怎么不弹出窗口呢?
VBScript code

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<script language="vbscript">
function aaa()
a1=shenfenzheng1.value
if a1 = "" then
msgbox "不能为空。"
end if
end function
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>
</title>
</head>
<body>
<form name="form1" method="post" action="">
  <input name="shenfenzheng1" type="text" id="shenfenzheng1">
  <input type="submit" name="Submit" value="检测" onClick="aaa()">
</form>
</body>
</html>



------解决方案--------------------
HTML code

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 2</title>
</head>

<body>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<script language="vbscript">
function aaa()
a1=document.getElementById("shenfenzheng1").value
if a1 = "" then
msgbox "不能为空。"
end if
end function
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>
</title>
</head>
<body>
<form name="form1" method="post" action="">
  <input name="shenfenzheng1" type="text" id="shenfenzheng1">
  <input type="submit" name="Submit" value="检测" onClick="aaa()">
</form>
</body>
</html>

</body>

</html>