Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML/CSS: How to make "password" input show the password?

How can you make the value in the password field visible? So, when typing your password in the field, it will not show the black dots, but the actual value that you are typing.

Thanks!

edit: Ok, so then a better question might be: How can I force the browser to remember the value in this 'password' field and treat it as a password?

like image 200
Alex Avatar asked Oct 23 '10 13:10

Alex


People also ask

How do I show password in password field?

Right-click the password field and click Inspect Element. A gray bar will appear with the password field highlighted. Press Alt+M or click on the icon shown below to open the Markup Panel. It will show you the code for the password field.

How do you put a password on a input box in HTML?

The <input> tag with a type="password" attribute creates a text field where users can securily enter a password. As characters are entered, they are replaced by a dot ("•") or asterisk ("*") symbol, depending on the browser.

Which HTML code will display a password field?

The <input type="password"> defines a password field (characters are masked). Note: Any forms involving sensitive information like passwords should be served over HTTPS.

How do you make a password invisible and visible in HTML?

Create HTML Login form with Eye Icon First of all import the awesome font Stylesheet into your HTML form page. Use the tag <i> to display the eye icon. This icon is also known as the visibility eye icon. Use the below CSS to put the eye icon at the end of the password text field.


2 Answers

Don't make it a password field, make it a normal text box.

If you need to switch the field type dynamically, there is a HOWOTO over on codingforums.com, and also several SO questions:

  • Javascript IE6/7/8 change input type
  • Changing the <input> type in IE with JavaScript
  • Javascript change input type dynamically doesnt work on IE8
  • change type of input field with jQuery

To ensure that browsers keep their normal behavior (saving/not saving passwords) you can convert this back to a password field upon submit.

like image 191
Brad Avatar answered Oct 19 '22 19:10

Brad


How can you make the value in the password field visible? So, when typing your password in the field, it will not show the black dots, but the actual value that you are typing.

You can't.

You can, however, use a normal text input for the user to type in the password.

I wouldn't recommend this, though - for example, the browser might auto-save whatever you type in it. A autocomplete="off" is mandatory in any case.

Reference:

  • MSDN article on input elements in IE; mentions that the element.value property is always asterisks for password inputs, even when accessing it from JS

  • MDC: How to Turn Off Form Autocompletion

like image 45
Pekka Avatar answered Oct 19 '22 19:10

Pekka