标题:哪位师傅看看问题出在哪谢谢!
只看楼主
暮色苍鹰
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-7-14
 问题点数:0 回复次数:1 
哪位师傅看看问题出在哪谢谢!
当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">&nbsp;</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%">&nbsp;</td>
            </tr>
            <tr>
              <td><div align="center">密码</div></td>
              <td colspan="2"><label>
                <input type="text" name="pwd" />
              </label></td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</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>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td colspan="2"><a href="register.asp" >新学生注册</a></td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td colspan="2"><p><a href="admin/index.asp">后台管理程序入</a></p>                </td>
              <td>&nbsp;</td>
            </tr>
          </table>
            <p>&nbsp;</p></td>
          <td width="356"><p>&nbsp;</p>
            <p align="center"><img src="gif/晚霞.jpg" width="139" height="104" /></p></td>
        </tr>
      </table>
        </form>
    </td>
  </tr>
</table>



</body>
</html>
搜索更多相关主题的帖子: 师傅 DTD title text 
2008-07-14 15:00
abc888
Rank: 1
等 级:新手上路
威 望:1
帖 子:90
专家分:0
注 册:2007-4-24
得分:0 
if(docuemnt.form1.pwd.value=="")   -->  if(document.form1.pwd.value=="")
alert("请输入用户密码");         -->  alert("请输入用户密码");//右括号和分号不对

编海无涯,回头死岸
2008-07-30 14:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-223846-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015718 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved