This topic is locked

Show password while writing to log

9/26/2022 3:06:49 PM
PHPRunner General questions
A
alfonso authorDevClub member

Is there a way to make it show the password that someone is typing when they are signing in? Thank you
That is, either you can see directly what is written or there is a button to the right that, when you click on it, shows us the password that we have written

Admin 9/26/2022

Yes, using a button or a checkbox you can do that. Your task will be to change type attribute of the input tag.

By default it will be something like this:
<input type="password" name="password" ... >

You will need to chnage it this way to display the password:
<input type="text" name="password" ... >

And to change the value of this attribute you can use jQuery's attr() function.
$("input[type='password']").attr("type", "text");

A
alfonso authorDevClub member 9/26/2022

Thanks.
Does anyone have any ideas to do something like the password for the phprunner program for example (the icon with an eye that shows/hides the password)?

img alt

A
alfonso authorDevClub member 9/26/2022

I want to say that this code, if I add it to a button, it shows the password, but I would need the release of the button to hide the password again

$("input[type='password']").attr("type", "text");

A
alfonso authorDevClub member 10/11/2022

Any new idea?

Admin 10/12/2022

I have provided the answer and code. What exactly is the problem with using this code?