Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Hello, world!</title>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
- </script>
- <script>
- (function(){
- $('form > input').keyup(function(){
- var empty = false;
- $('form > input').each(function(){
- if ($(this).val() == ''){
- empty = true;
- }
- });
- if (empty){
- $('#submitForm').prop('disabled','disabled');
- } else {
- $('#submitForm').prop('disabled',false);
- }
- });
- })()
- </script>
- </head>
- <body>
- <form method="POST">
- Username: <input type="text" name="username"><br>
- Password: <input type="password" name="password"><br>
- <input type="submit" id="submitForm" name="Log In" disabled="disabled">
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment