试试下面这个,我测试已经通过,红色为我修改的地方,根据楼主一楼代码修改。
<html>
<head>
<title>请输入用户名和密码</title>
</head>
<body>
<script language="vbscript">
function ChkFields()
If document.MyForm.UserName.value="" then
MsgBox("请输入用户名!")
return.false
End if
If document.MyForm.Pwd.value="" then
MsgBox("请输入密码!")
return.false
End if
End function
</script>
<p align="center"><font color="#000000" size="+5">身 份 验 证</font></p>
<p align="center"><font color="#000000">
<%=Errmsg%>
</font></p>
<form method="post" action="" name="Myform" onsubmit="return ChkFields()">
<table width="361" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="92"><font size="-1">用户名:</font></td>
<td width="269"><font size="+1">
<input name="UserName" type="text" size="12">
</font></td>
</tr>
<tr>
<td><font size="-1">密码:</font></td>
<td><font size="+1">
<input name="Pwd" type="password" size="12">
</font></td>
</tr>
</table>
<table width="364" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="364" height="24"><div align="center">
<input type="submit" name="submit1" value="提交">
</div></td>
</tr>
</table>
<p align="center"> </p>
</form>
</body>
</html>
<html>
<head>
<title>请输入用户名和密码</title>
</head>
<body>
<script language="vbscript">
function ChkFields()
If document.MyForm.UserName.value="" then
MsgBox("请输入用户名!")
return.false
End if
If document.MyForm.Pwd.value="" then
MsgBox("请输入密码!")
return.false
End if
End function
</script>
<p align="center"><font color="#000000" size="+5">身 份 验 证</font></p>
<p align="center"><font color="#000000">
<%=Errmsg%>
</font></p>
<form method="post" action="" name="Myform" onsubmit="return ChkFields()">
<table width="361" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="92"><font size="-1">用户名:</font></td>
<td width="269"><font size="+1">
<input name="UserName" type="text" size="12">
</font></td>
</tr>
<tr>
<td><font size="-1">密码:</font></td>
<td><font size="+1">
<input name="Pwd" type="password" size="12">
</font></td>
</tr>
</table>
<table width="364" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="364" height="24"><div align="center">
<input type="submit" name="submit1" value="提交">
</div></td>
</tr>
</table>
<p align="center"> </p>
</form>
</body>
</html>