<html>
<head>
   <title>登陆提示</title>
<script language="javascript">
function Page_Load()
{
<%
    Dim UsName,Pwd
    UsName=Request.Form("userName")
    Pwd=Request.Form(Pwd)
    IF Request.Form("IsSubmit")="True" Then
       IF UsName<>"abc" And Pwd<>"123" Then
          Response.Write "alert('用户名不是abc,密码不是123');"
       Else
          Response.Write "alert('登陆成功');"
       End IF
    End IF
%>
}
//表单提交方法
function form1_Sbumit()
{
   //判断用户名密码是否为空
   if(document.form1.userName.value=="")
   {
       alert('用户名不能为空');
       return false;
   }
   if(document.form1.passWord.value=="")
   {
       alert('密码不能为空');
       return false;
   }
   document.form1.action=self.location.href;//获得当前页的URL
   document.form1.submit();//提交表单
}
</script>
</head>
<body onLoad="Page_Load();">
<form name="form1" method="post" target="_self">
  <input type="text" name="userName"> 用户名<br>
  <input type="password" name="passWord">密码<br>
  <!--判断表单是否提交-->
  <input type="hidden" name="IsSubmit" value="True" >
  <input type="button" onClick="form1_Submit();" name="Submit" value="登陆">
</form>
</body>
</html>