哪位师傅看看问题出在哪谢谢!
当student和pwd文本框为空时不显示alert中的内容<%@LANGUAGE="JAVASCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE6 {
font-size: 36px;
font-style: italic;
color: #FF0000;
}
-->
</style>
<script language="javascript">
function check()
{
if(document.form1.student.value=="")
{alert("请输入用户名");
document.form1.student.focus();
return false;}
if(docuemnt.form1.pwd.value=="")
{alert("请输入用户密码");
document.form1.pwd.focus();
return false;}
document.form1.ctype.value="add";
document.form1.submit();
}</script>
</head>
<body>
<table align="center" width="758" height="152" border="0">
<tr>
<td width="736" height="100%" bgcolor="#33FF33"><div align="center" class="STYLE6">在线考试系统 </div></td>
</tr>
</table>
<table width="734" border="0" align="center" cellpadding="4" bordercolor="#1111111" style="border-collapse:collapse; position:absolute; left: 258px; top: 182px;">
<tr>
<td height="249"><form id="form1" name="form1" method="post" action="">
<input type="hidden" name="ctype" />
<table width="745" border="0" height="247">
<tr>
<td width="8"> </td>
<td width="359"><table width="100%" border="0" style="border-collapse:collapse" bordercolor="#111111" cellpadding="5" cellspacing="0" >
<tr>
<td width="21%"><div align="center">用户名</div></td>
<td colspan="2"><label>
<input type="text" name="student" />
</label></td>
<td width="18%"> </td>
</tr>
<tr>
<td><div align="center">密码</div></td>
<td colspan="2"><label>
<input type="text" name="pwd" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td width="23%"><label>
<input type="button" onclick="check()" name="Submit" value="提交" >
</label></td>
<td width="38%"><label>
<input type="submit" name="Submit2" value="重置" />
</label></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><a href="register.asp" >新学生注册</a></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><p><a href="admin/index.asp">后台管理程序入</a></p> </td>
<td> </td>
</tr>
</table>
<p> </p></td>
<td width="356"><p> </p>
<p align="center"><img src="gif/晚霞.jpg" width="139" height="104" /></p></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>