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
|
// 'show password' checkbox
|
||||||
$('#password').showPassword();
|
|
||||||
$('#adminpass').showPassword();
|
var hideToggleBtn = function(input, label) {
|
||||||
$('#pass2').showPassword();
|
// '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
|
//use infield labels
|
||||||
$("label.infield").inFieldLabels({
|
$("label.infield").inFieldLabels({
|
||||||
|
|
Loading…
Reference in New Issue