login.jsp

来自「主要是航空预订系统」· JSP 代码 · 共 72 行

JSP
72
字号
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html:html>
<head>
<style type="text/css">
<!--
.STYLE1 {
	font-size: 18px;
	font-weight: bold;
}
-->
</style>
<script type="text/javascript" language="javascript">
function isEmpty(id,div,label){
	var eid = document.getElementById(id);
	if(eid.value.length==0){
		document.getElementById(div).innerHTML=label+"不能为空";
		return false;
	}
	document.getElementById(div).innerHTML="";
	return true;
}
function onSubmitCheck(){
	var bUserName = isEmpty('username','usernameDiv','用户名');
	var bPassword = isEmpty('password','passwordDiv','密码');
	if(bUserName&&bPassword){
		return true;
	}
	return false;
}
</script>
</head>

<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<html:form action="/loginAction.do?u=admin" method="post" focus="username" onsubmit="return onSubmitCheck();">
<table width="744" height="129" border="1" align="center">
  <tr>
    <th colspan="3" scope="col"><span class="STYLE1">管理员登录</span></th>
  </tr>
  <tr>
    <td width="169">用户名:</td>
    <td width="212"><label>
      <input type="text" name="username" id="username" onblur="isEmpty('username','usernameDiv','用户名')"/>
    </label></td>
    <td width="341"><div id="usernameDiv" style="display:block;color:red">&nbsp;</td>
  </tr>
  <tr>
    <td>密码:</td>
    <td><label>
      <input type="password" name="password" id="password" onblur="isEmpty('password','passwordDiv','密码')"/>
    </label></td>
    <td><div id="passwordDiv" style="display:block;color:red"></div>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3"><label>
      <input type="submit" name="Submit" value="登录" />
    </label>
      <label>
      <input type="reset" name="Submit2" value="重置" />
    </label></td>
  </tr>
</table>
</html:form>
</body>
</html:html>

⌨️ 快捷键说明

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