Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
- <script>
- $(document).ready(function() {
- $(':input[type="submit"]').prop('disabled', true);
- $('input[type="email"]').keyup(function() {
- if($(this).val() != '') {
- $(':input[type="submit"]').prop('disabled', false);
- }
- });
- $('#loginButton').click(function() {
- var ValidUser = $('#usernameInput').val() === 'admin@company.com';
- var ValidPassword = $('#passwordInput').val() === 'dogcat';
- if (ValidEmail === true && ValidPassword === true)
- {
- alert("Login Successful");
- }
- else
- {
- alert("Incorrect Username/Password");
- }
- });
- });
- </script>
- <title>Login</title>
- </head>
- <body>
- <div id="loginMenu">
- <span>
- <form id="formLogin" name="login">
- <Label>Username:</Label>
- <br/>
- <input id="usernameInput" name = "username" type="email" required="required">
- <br/>
- <label>Password:</label>
- <br/>
- <input id="passwordInput" name="password" type="password" required="required">
- <br/>
- <input id="loginButton" type="submit" value="Log In">
- </form>
- </span>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment