Initial Commit : Password Toggle Button hides if no input present

This commit is contained in:
raghunayyar 2013-03-25 04:30:09 +05:30
parent 0e55b61169
commit d9cd9875e0
1 changed files with 15 additions and 3 deletions

View File

@ -638,9 +638,21 @@ $(document).ready(function(){
});
// 'show password' checkbox
$('#password').showPassword();
$('#adminpass').showPassword();
$('#pass2').showPassword();
var hideToggleBtn = function(input, label) {
// 'show password' checkbox
input.showPassword().keyup(function(){
if (input.val().length == 0) {
label.hide();
} else {
label.css("display", "inline").show();
}
});
label.hide();
};
hideToggleBtn($('#password'), $('label[for=show]'));
hideToggleBtn($('#adminpass'), $('label[for=show]'));
hideToggleBtn($('#pass2'), $('label[for=personal-show]'));
//use infield labels
$("label.infield").inFieldLabels({