Advertisement
Guest User

Untitled

a guest
Mar 17th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.  
  5.  
  6.  
  7. </head>
  8.  
  9. <body>
  10.  
  11. <script src="js/jquery-3.2.0.js"></script>
  12. <script src="js/FormSample.js"></script>
  13.  
  14. <p> Please note, the password MUST contain atleast one Uppercase letter and one number. The password MUST be 6 letters long.</p>
  15.  
  16. <form name="myForm">
  17. <form onsubmit="return checkForm(this);">
  18. <p>Username: <input type="text" name="username"></p>
  19. <p>Password: <input type="password" id="password" name="pwd1"> </p>
  20. <p>Confirm Password: <input type="password" id="confirm_password" name="pwd2"><span id='message'></p>
  21.  
  22.  
  23. <br><br>
  24. <input type="Submit" value="Submit">
  25.  
  26. </form>
  27.  
  28.  
  29. <script type="text/javascript">
  30.  
  31. $('#password, #confirm_password').on('keyup', function () {
  32. if ($('#password').val() == $('#confirm_password').val()) {
  33. $('#message').html('Matching').css('color', 'green');
  34. } else
  35. $('#message').html('Not Matching').css('color', 'red');
  36. });
  37.  
  38. //This is to grab my username from the form
  39. jsvar = document.myform4.username.value;
  40. // document.write(jsvar) // test
  41. document.getElementById("demo").write(jsvar);
  42.  
  43.  
  44. </script>
  45. <p> Listen man save some shit</p>
  46. <button type="button" onclick='document.getElementById("demo").innerHTML = (jsvar)'>Click Me!</button>
  47. <p id="demo"></p>
  48.  
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement