Created
October 30, 2009 03:06
-
-
Save notbenh/222075 to your computer and use it in GitHub Desktop.
This file contains 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
<html> | |
<head> | |
<script src="jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript"> | |
function password_border_management() { | |
var pw1 = $('#pw1'); | |
var pw2 = $('#pw2'); | |
if (pw1.val() == pw2.val() | |
&& pw1.val().length >= 6 && pw1.val().length <= 12 | |
&& pw2.val().length >= 6 && pw2.val().length <= 12 | |
) { | |
pw1.css('border','10px solid green'); | |
pw2.css('border','10px solid green'); | |
} | |
else { | |
pw1.css('border','10px solid red'); | |
pw2.css('border','10px solid red'); | |
} | |
}; | |
$(document).ready(function() { | |
$("input[name*=pw]").ready(password_border_management).keypress(password_border_management); | |
}); | |
</script> | |
</head> | |
<body> | |
<label for="pw1">Create Password <span class="req">*</span></label> | |
<input type="password" size="30" name="pw1" minlength="6" maxlength="30" id="pw1" class="required" /> | |
<label for="pw2">Confirm Password <span class="req">*</span></label> | |
<input type="password" size="30" minlength="6" name="pw2" maxlength="30" id="pw2" class="required" /> | |
<p class="instructions">Select a password between 6 and 30 characters. Throw in a digit or capital letter for extra added security.</p> | |
</body> | |
<html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment