Created
November 7, 2013 14:38
-
-
Save mikedugan/7355609 to your computer and use it in GitHub Desktop.
compares 2 password to make sure they match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Code Block used displaying color code on passwords. | |
| function PasswordValidator() { | |
| $(document).ready(function() { | |
| $('#m2_MB_txt_UserPass2').hide(); | |
| $("#m2_MB_txt_UserPass1").keyup(function(event) { | |
| var textBox = document.getElementById("m2_MB_txt_UserPass1"); | |
| var count = textBox.value.length; | |
| if (count > 5) { | |
| $('#m2_MB_txt_UserPass2').show(); | |
| $('#m2_MB_txt_UserPass2').css('border', '1px solid #FF0000'); | |
| $('#m2_MB_txt_UserPass1').css('border', '1px solid #00FF00'); | |
| } else { | |
| $('#m2_MB_txt_UserPass2').hide(); | |
| $('#m2_MB_txt_UserPass1').css('border', '1px solid #FF0000'); | |
| } | |
| }); | |
| $("#m2_MB_txt_UserPass2").keyup(function(event) { | |
| var textBox1 = document.getElementById("m2_MB_txt_UserPass1"); | |
| var textBox2 = document.getElementById("m2_MB_txt_UserPass2"); | |
| if (textBox1.value == textBox2.value) { | |
| $('#m2_MB_txt_UserPass2').css('border', '1px solid #00FF00'); | |
| } else { | |
| $('#m2_MB_txt_UserPass2').css('border', '1px solid #FF0000'); | |
| } | |
| }); | |
| }); | |
| } //END PasswordValidator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment