Guest User

Untitled

a guest
Feb 2nd, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.18 KB | None | 0 0
  1. <%@page import="java.util.ArrayList"%>
  2. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  3. pageEncoding="ISO-8859-1"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7.  
  8. <title>
  9. Register
  10. </title>
  11. <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css" />
  12. <link rel="stylesheet" href="${pageContext.request.contextPath}/css/styles.css">
  13. <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
  14. <style type="text/css">
  15. body {
  16. background: url("${pageContext.request.contextPath}/images/background.jpg");
  17. }
  18. .user-icon {
  19. top:153px; /* Positioning fix for slide-in, got lazy to think up of simpler method. */
  20. background: rgba(65,72,72,0.75) url('${pageContext.request.contextPath}/images/user-icon.png') no-repeat center;
  21. }
  22.  
  23. .pass-icon {
  24. top:201px;
  25. background: rgba(65,72,72,0.75) url('${pageContext.request.contextPath}/images/pass-icon.png') no-repeat center;
  26. }
  27.  
  28.  
  29. </style>
  30. </head>
  31.  
  32. <script>
  33. function validate(){
  34. var form = document.getElementById("form");
  35. //alert(form['email'].value);
  36. if(form['email'].value.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)){
  37. if(form['username'].value.length >= 5 ){
  38. alert(form['password'].value);
  39. alert(form['confirm_password'].value);
  40. if(form['password'].value == form['confirm_password'].value && form['password'].value.length >= 8){
  41.  
  42. if(form['answer'].value.length > 1 ){
  43. return true;
  44. }
  45. else{
  46. alert("Answer cannot be empty!");
  47. return false;
  48. }
  49. }
  50. else{
  51. alert("Passwords Do not Match or less than 8 chars");
  52. return false;
  53. }
  54. }
  55. else{
  56. alert("Username should be 5 chars long");
  57. return false;
  58. }
  59. }
  60. else{
  61. alert("Invalid or Email Not Provided");
  62. return false;
  63. }
  64. }
  65. </script>
  66.  
  67. <body>
  68.  
  69. <div id='cssmenu'>
  70. <ul>
  71. <li class=''><a href='${pageContext.request.contextPath}/'><span>Home</span></a></li>
  72. <c:if test='${empty sessionScope.user}'>
  73. <li><a href='${pageContext.request.contextPath}/login'><span>Login</span></a></li>
  74. <li><a href='${pageContext.request.contextPath}/register'><span>Register</span></a></li>
  75. </c:if>
  76. </ul>
  77. </div>
  78.  
  79. <div id="wrapper">
  80.  
  81. <div id="errors"></div>
  82. <form name="login-form" class="login-form" action="checkRegister" id="form" method="post" onsubmit="return validate()">
  83.  
  84. <div class="header">
  85. <h1>Register </h1>
  86. <span></span>
  87. </div>
  88.  
  89. <div class="content">
  90. <label for="email">Email ID: </label><br>
  91. <input name="email" id="email" type="text" class="input username" placeholder="Email" /><br>
  92. <div class="user-icon"></div>
  93. <label for="username">Username:</label><br>
  94. <input name="username" id="username" type="text" class="input username" placeholder="Username" /><br>
  95. <div class="user-icon"></div>
  96. <label for="password">Password:</label><br>
  97. <input name="password" type="password" id="password" class="input password" placeholder="Password" /><br>
  98. <div class="user-icon"></div>
  99. <label for="confirm_password">Confirm Password: </label><br>
  100. <input name="confirm_password" type="password" id="confirm_password" class="input password" placeholder="Confirm Password" /><br>
  101. <div class="user-icon"></div>
  102. <label for="fullName">Full Name: </label><br>
  103. <input name="fullName" type="text" id="fullName" class="input username" placeholder="Full Name(optional)" /><br>
  104. <div class="user-icon"></div>
  105. <label for="security_ques">Security Question: </label><br>
  106. <select name="security_ques" id="security_ques" class="input username">
  107. <option value="What is your favorite movie?">What is your favorite movie?</option>
  108. <option value="What is your mother's maiden name?">What is your mother's maiden name?</option>
  109. <option value="What street did you grow up on?">What street did you grow up on?</option>
  110. <option value="What was the make of your first car?">What was the make of your first car?</option>
  111. <option value="What is the name of your first grade teacher?">What is the name of your first grade teacher?</option>
  112. </select><br>
  113. <div class="user-icon"></div>
  114. <label for="answer">Answer: </label><br>
  115. <input name="answer" type="text" id="answer" class="input username" placeholder="Answer" /> <br>
  116. </div>
  117.  
  118. <div class="footer">
  119. <input type="submit" class="button" name="submit" value="Register" class="register" />
  120. </div>
  121.  
  122. </form>
  123.  
  124.  
  125. </div>
  126. <div class="gradient"></div>
  127.  
  128.  
  129. </body>
  130. </html>
Add Comment
Please, Sign In to add comment