Initial Commit : Password Toggle Button hides if no input present
This commit is contained in:
parent
0e55b61169
commit
d9cd9875e0
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue