Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <script type="text/javascript">
  2. $(function(){
  3. $('#jq-password [type="password"]').keyup(function(){
  4. //Store the field objects into variables ...
  5. var password = $('#password3');
  6. var confirm = $('#confirm3');
  7. var message = $('#confirm-message3');
  8.  
  9. //Set the colors we will be using ...
  10. var good_color = "#66cc66";
  11. var bad_color = "#ff6666";
  12.  
  13. if(password.val() == confirm.val()){
  14. confirm.css('background-color', good_color);
  15. message.css('color', good_color).html("Passwords Match!");
  16. } else {
  17. confirm.css('background-color', bad_color);
  18. message.css('color', bad_color).html("Passwords Do Not Match!");
  19. }
  20. });
  21. });
  22. </script>
  23. <div class="tutorial-wrapper">
  24. <form id="jq-password">
  25. <div class="field-wrapper">
  26. <label for="password2">Password:</label>
  27. <input type="password" name="password" id="password3">
  28. </div>
  29. <div class="field-wrapper">
  30. <label for="confirm2">Confirm Password:</label>
  31. <input type="password" name="confirm" id="confirm3">
  32. <span id="confirm-message3" class="confirm-message"></span>
  33. </div>
  34. </form>
  35. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement