login.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="shortcut icon" href="/static/img/favicon.png" />
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <link href="http://cdn.staticfile.org/twitter-bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" />
  7. <title>Login</title>
  8. </head>
  9. <body>
  10. <div class="container" style="width: 500px;">
  11. <form class="form-horizontal" method="POST" action="/login">
  12. <div class="form-group">
  13. <label class="col-lg-4 control-label">Username:</label>
  14. <div class="col-lg-6">
  15. <input id="uname" class="form-control" name="uname" placeholder="Account">
  16. </div>
  17. </div>
  18. <div class="form-group">
  19. <label class="col-lg-4 control-label">Password:</label>
  20. <div class="col-lg-6">
  21. <input id="pwd" type="password" class="form-control" name="pwd" placeholder="Password">
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <div class="col-lg-offset-2 col-lg-10">
  26. <a href="/login"><button type="submit" class="btn btn-default" onclick="return checkInput();">Login</button></a>
  27. <button class="btn btn-default" onclick="return backToHome();">Go To Home</button>
  28. <script type="text/javascript">
  29. function backToHome() {
  30. window.location.href = "/";
  31. return false;
  32. }
  33. function checkInput() {
  34. var uname = document.getElementById("uname");
  35. if (uname.value.length == 0) {
  36. alert("Please Input Your Account");
  37. return false;
  38. }
  39. var pwd = document.getElementById("pwd");
  40. if (pwd.value.length == 0) {
  41. alert("Please Input Your Password");
  42. return false;
  43. }
  44. }
  45. </script>
  46. </div>
  47. </div>
  48. </form>
  49. </div>
  50. </body>
  51. </html>