hide and show password
4 posters
Page 1 of 1
hide and show password
how can i make a button to hide and show passwords
i wote that code but doesn't work
i wote that code but doesn't work
- Code:
$(function(){
$('input[name="password"]').replaceWith('<input type="password" name="password" size="25" maxlength="25" class="inputbox autowidth" /> <span style="font-family: FontAwesome;" id="shIcon"></span>');
$('input[name="password"]').attr('id', 'password');
});
var myInput = document.getElementById("password"),
myBtn = document.getElementById("shIcon");
myBtn.onclick = function () {
if (this.textContent === "" ) {
myInput.setAttribute('type','text');
this.textContent('')
} else {
myInput.setAttribute('type','password');
this.textContent('');
}
};
Re: hide and show password
Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead! This is your 3rd warning about this any more and we will be marking you on your warning bar
|
Re: hide and show password
close topic iolved it
- Code:
// Show/Hide password
$(function() {
$('input[name="password').attr('id','password');
$('<span class="show-pass" id="shIcon"></span>').insertAfter('input[name="password');
$('head').append('<style rel="stylesheet" type="text/css">.hide-pass:after {content:"hide";}.show-pass:after {content: "show";}</style>
');
var myInput = document.getElementById("password"),
myBtn = document.getElementById("shIcon");
myBtn.onclick = function() {
if(myInput.type === "password") {
myInput.type = 'text';
this.className = 'hide-pass';
} else {
myInput.type = 'password';
this.className = 'show-pass';
}
};
});
//by omarpop23
Re: hide and show password
Where exactly does this appear on your forum?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: hide and show password
So it is for logging in? I really do not see why you would want this.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: hide and show password
SLGray wrote:So it is for logging in? I really do not see why you would want this.
It's so people can see if they made a mistake entering their password. And by the way, I think he wants it marked as solved.
omarpop23 wrote:close topic iolved it
Re: hide and show password
Problem solved & topic archived.
|
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» How to show/hide who is online?
» Categories hide/show
» Transition on show/hide JQ
» Show hide widget
» Sidebar hide/show
» Categories hide/show
» Transition on show/hide JQ
» Show hide widget
» Sidebar hide/show
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum