谢谢先:
代码如下:
<%@ page contentType="text/html; charset=gb2312" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<head>
<title>管理员进入</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<script language="javascript">
  function checkform() {
if (document.form1.username.value==""||document.form1.passwd.value==""){
alert("用户名或密码为空!");
return false;
}
return true;
  }
</script></head>
<LINK href="hellking.css" type=text/css rel=stylesheet>
<body bgcolor="#FFCC99" text="#000000" align="top">
<div align="center">
  <table width="100%" border="0" height="100%" cellspacing="0" cellpadding="0" >
    <tr> 
      <td align="center"> 
        <form name="form1" method="past" action="adminlogin.jsp" target="_new" align="top" onSubmit="return checkform()">
          <table width="360" border="1" cellspacing="2" cellpadding="2" bgcolor="#66CCFF" bordercolor="#66CCFF" style="font-size:9pt">
            <tr align="center"> 
              <td colspan="2"> 
                <h3><br>
                  <font>进入管理系统</font></h3>
               
              </td>
            </tr>
            <tr> 
              <td align="right" width="150">管理员:</td>
              <td> 
                <input type="text" name="username" size="12" maxlength="20">
              </td>
            </tr>
            <tr> 
              <td align="right" width="150">管理员密码:</td>
              <td> 
                <input type="password" name="passwd" size="12" maxlength="20">
              </td>
            </tr>
            <tr align="center"> 
              <td colspan="2"> 
                <input type="submit" name="Submit" value="登录" >
                <input type="reset" name="Submit2" value="取消">
              </td>
    </tr>
  </table>
    </form>
  </table>
  
</div>
</body>
</html>

解决方案 »

  1.   

    或者哪位朋友给我COPY个有用的JAVASCRIPT的用户登录代码吧,
    谢了
      

  2.   

    以前好象也有过类似的情形,当第一次登陆时由于页面的USERNAME和PASSWORD都为空,故而会弹出警告窗口。
    试试在代码中加入一变量<%byte i=0;%>,当第一次登陆时初始为0而并不弹出警告窗口,点击提交后I++;(弹出窗口的条件需"与&&"上I>0)
      

  3.   

    what is the relation between your code and your html file(http://127.0.0.1:8080/use.html)
    what is the meaning of [可我用http://127.0.0.1:8080/use.html时就不会提示]
      

  4.   

    谢谢先:
    代码如下:
    <%@ page contentType="text/html; charset=gb2312" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <head>
    --------
    这哪是html,第一行明明就是jsp啊
    呵呵,去掉第一行
      

  5.   

    为什么不写在登陆的按妞的onClick事件中呢??
      

  6.   

    <form name="form1" method="past" action="adminlogin.jsp" target="_new" align="top" onSubmit="return checkform()">past 改成 POST