Guest User

Untitled

a guest
Mar 21st, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. <head>
  2. <title> Sign up </title>
  3. <link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
  4. <script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  5. <link rel="stylesheet" href="/css/signup.css">
  6. <script type="text/javascript">
  7.  
  8.  
  9. function validate_form() {
  10. let username = document.getElementById('username').value;
  11. let firstName = document.getElementById('firstName').value;
  12. let lastName = document.getElementById('lastName').value;
  13. let email = document.getElementById('email').value;
  14. let input_password = document.getElementById('input_password').value;
  15. let input_password2 = document.getElementById('input_password2').value;
  16.  
  17. if (username == "" | username == null)
  18. document.getElementById('username').style.display = 'block';
  19. if (firstName == "" | firstName == null)
  20. document.getElementById('alert_firstname').style.display = 'block';
  21. if (lastName == "" | lastName == null)
  22. document.getElementById('alert_laname').style.display = 'block';
  23. if (email == "" | email == null)
  24. document.getElementById('alert_email').style.display = 'block';
  25. if (input_password == "" | input_password == null)
  26. document.getElementById('alert_password').style.display = 'block';
  27. if (input_password2 == "" | input_password2 == null)
  28. document.getElementById('alert_password2').style.display = 'block';
  29. if (input_password != "" && input_password2 != "" && input_password != input_password2)
  30. document.getElementById('alert_samepassword').style.display = 'block';
  31.  
  32. return (username != "") &&
  33. (firstName != "") &&
  34. (lastName != "") &&
  35. (email != "") &&
  36. (input_password != "") &&
  37. (input_password2 != "");
  38. }
  39. </script>
  40. </head>
  41.  
  42. <body>
  43. <div class="col-md-4">
  44. <div class="panel panel-default">
  45. <div class="panel-heading"><h3 class="panel-title"><strong>Sign up </strong></h3></div>
  46. <div class="panel-body">
  47. <form role="form" method="POST" action="/signup" onsubmit="return validate_form();">
  48. <div class="form-group">
  49. <label for="username">Username</label>
  50. <label id="alert_username">You should enter a username</label>
  51. <h3 id="taken"> </h3>
  52. <input type="text" class="form-control" name="username" id="username" placeholder="Enter a username"
  53. onkeyup="check(this.value)">
  54. </div>
  55.  
  56. <div class="form-group">
  57. <label for="firstName">First name</label>
  58. <label id="alert_firstname">You should enter your first name</label>
  59. <input type="text" class="form-control" name="firstName" id="firstName" placeholder="Enter your first name">
  60. </div>
  61.  
  62. <div class="form-group">
  63. <label for="lastName">Last name</label>
  64. <label id="alert_lastname">You should enter your last name</label>
  65. <input type="text" class="form-control" name="lastName" id="lastName" placeholder="Enter your last name">
  66. </div>
  67.  
  68. <div class="form-group">
  69. <label for="input_password">Password </label>
  70. <label id="alert_password">You should enter a password</label>
  71. <input type="password" class="form-control" name="input_password" id="input_password" placeholder="Password">
  72. </div>
  73.  
  74. <div class="form-group">
  75. <label for="input_password2">Password </label>
  76. <label id="alert_password2">You should enter a password</label>
  77. <label id="alert_samepassword">Password and confirmation should be the same</label>
  78. <input type="password" class="form-control" id="input_password2" placeholder="Confirm your password">
  79. </div>
  80.  
  81. <div class="form-group">
  82. <label for="email">Email</label>
  83. <label id="alert_email">You should enter your email</label>
  84. <input type="email" class="form-control" name="email" id="email" placeholder="Enter a valid email">
  85. </div>
  86.  
  87. <button type="submit" class="btn btn-primary btn-default">Sign up</button>
  88. <button type="button" class="btn btn-success" onclick="window.location.href='/signin'">Already have an account?</button>
  89. </form>
  90. </div>
  91. </div>
  92. </div>
  93. </body>
  94.  
  95. </html>
Add Comment
Please, Sign In to add comment