Guest User

Untitled

a guest
Jun 9th, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
  5. <script>
  6. $(document).ready(function() {
  7. $(':input[type="submit"]').prop('disabled', true);
  8. $('input[type="email"]').keyup(function() {
  9. if($(this).val() != '') {
  10. $(':input[type="submit"]').prop('disabled', false);
  11. }
  12. });
  13. $('#loginButton').click(function() {
  14. var ValidUser = $('#usernameInput').val() === 'admin@company.com';
  15. var ValidPassword = $('#passwordInput').val() === 'dogcat';
  16. if (ValidEmail === true && ValidPassword === true)
  17. {
  18. alert("Login Successful");
  19. }
  20. else
  21. {
  22. alert("Incorrect Username/Password");
  23. }
  24. });
  25. });
  26. </script>
  27.  
  28. <title>Login</title>
  29.  
  30. </head>
  31.  
  32. <body>
  33. <div id="loginMenu">
  34. <span>
  35. <form id="formLogin" name="login">
  36. <Label>Username:</Label>
  37. <br/>
  38. <input id="usernameInput" name = "username" type="email" required="required">
  39. <br/>
  40. <label>Password:</label>
  41. <br/>
  42. <input id="passwordInput" name="password" type="password" required="required">
  43. <br/>
  44. <input id="loginButton" type="submit" value="Log In">
  45. </form>
  46. </span>
  47. </div>
  48. </body>
  49. </html>
Add Comment
Please, Sign In to add comment