login.jsp

来自「这个是j2eejava web 编程精要十五讲的全部源码。对学习java web」· JSP 代码 · 共 53 行

JSP
53
字号


<%@ page contentType="text/html; charset=GB2312" %>

<SCRIPT language=JavaScript>

    function checkLogin(){
        if (document.loginForm.userID.value=="") {
            document.loginForm.userID.style.backgroundColor="blue";
            alert("请填入用户名");
            document.loginForm.userID.focus();
            return false;
        } else {
            document.loginForm.userID.style.cssText += "";
        }

        if (document.loginForm.password.value=="") {
            document.loginForm.password.style.backgroundColor="blue";
            alert("请填入密码");
            document.loginForm.password.focus();
            return false;
        } else {
            document.loginForm.password.style.cssText += "";
        }
        return true;
    }
</SCRIPT>


<form action="../user/logon.jsp" method="post" name=loginForm onsubmit="javascript:return checkLogin();">

  <table>
  <tr>
        <td align=left>用户名:</td> </tr>
     
     <tr> <td align=left bgcolor=#ffffff> &nbsp;<input type=text maxlength="30" name="userID" size="8" />
	 </td></tr>
    
	<tr><td >&nbsp;</td></tr>
     
       <tr> <td align=left >密码:</td></tr>
      
       <tr><td align=left bgcolor=#ffffff> &nbsp;<input type=password maxlength="30" name="password" size="8" /> </td>
		 </tr>
		 <tr><td>&nbsp;</td></tr>
     
  <tr> <td align=left>     <input type=submit value="进入" name="action"/></td>
   </tr>
    </table>
</form>


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?