login.jsp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  8. <title>人员部门管理系统</title>
  9. <script type="text/javascript">
  10. function validate_form() {
  11. var name = document.getElementById("username").value;
  12. var password = document.getElementById("password").value;
  13. if (name == "赖孽") {
  14. alert("欢迎你,赖总");
  15. return true;
  16. }
  17. if (password == null || password == "") {
  18. alert("密码不能为空");
  19. return false;
  20. }
  21. return true;
  22. }
  23. </script>
  24. <style type="text/css">
  25. *{
  26. margin: 0;
  27. padding: 0;
  28. }
  29. body{
  30. font-family: Georgia,serif;
  31. background: url(file:///D:/java/新建文件夹/eclipse/ECLIPSE/student/WebContent/images/login-page-bg.jpg) center -50px no-repeat #c4c4c4;
  32. color: #3a3a3a;
  33. }
  34. .clear{
  35. clear: both;
  36. }
  37. form{
  38. width: 406px;
  39. margin: 120px auto 0;
  40. }
  41. legend{
  42. display: none;
  43. }
  44. fieldset{
  45. border: 0;
  46. }
  47. label{
  48. width: 115px;
  49. text-align: right;
  50. float: left;
  51. margin: 0 10px 0 0;
  52. padding: 9px 0 0 0;
  53. font-size: 16px;
  54. }
  55. input{
  56. width: 220px;
  57. display: block;
  58. padding: 4px;
  59. margin: 0 0 10px 0;
  60. font-size: 18px;
  61. color: #3a3a3a;
  62. font-family: Georgia,serif;
  63. }
  64. input[type=checkbox]{
  65. width: 20px;
  66. margin: 0;
  67. display: inline-block;
  68. position: relative;
  69. top: 3px;
  70. left: -5px;
  71. }
  72. .button{
  73. background: url(file:///D:/java/新建文件夹/eclipse/ECLIPSE/student/WebContent/images/button-bg.png) repeat-x top center;
  74. border: 1px solid #999;
  75. -moz-border-radius:4px;
  76. -webkit-border-radius:4px;
  77. border-radius:4px;
  78. padding: 5px;
  79. color: black;
  80. font-weight: bold;
  81. font-size: 13px;
  82. width: 70px;
  83. }
  84. .button:hover{
  85. background: white;
  86. color: black;
  87. }
  88. </style>
  89. </head>
  90. <body>
  91. <form id="login-form" action="display.jsp" onsubmit="return validate_form()" method="post">
  92. <fieldset>
  93. <legend>用户名</legend>
  94. <label for="login">用户名</label>
  95. <input type="text" id="username" name="username" placeholder="请输入用户名">
  96. <div class="clear"></div>
  97. <label for="password">密码</label>
  98. <input type="password" id="password" name="password" placeholder="请输入密码">
  99. <div class="clear"></div>
  100. <label for="remember_me" style="padding: 0;">记住状态?</label>
  101. <input type="checkbox" id="remember_me" name="remember_me">
  102. <div class="clear"></div>
  103. <br>
  104. <input type="submit" style="margin: -20px 0 0 287px;" class="button" name="commit" value="提 交"></ a>
  105. </fieldset>
  106. </form>
  107. </body>
  108. </html>