Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(function(){
- $('#jq-password [type="password"]').keyup(function(){
- //Store the field objects into variables ...
- var password = $('#password3');
- var confirm = $('#confirm3');
- var message = $('#confirm-message3');
- //Set the colors we will be using ...
- var good_color = "#66cc66";
- var bad_color = "#ff6666";
- if(password.val() == confirm.val()){
- confirm.css('background-color', good_color);
- message.css('color', good_color).html("Passwords Match!");
- } else {
- confirm.css('background-color', bad_color);
- message.css('color', bad_color).html("Passwords Do Not Match!");
- }
- });
- });
- </script>
- <div class="tutorial-wrapper">
- <form id="jq-password">
- <div class="field-wrapper">
- <label for="password2">Password:</label>
- <input type="password" name="password" id="password3">
- </div>
- <div class="field-wrapper">
- <label for="confirm2">Confirm Password:</label>
- <input type="password" name="confirm" id="confirm3">
- <span id="confirm-message3" class="confirm-message"></span>
- </div>
- </form>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement