15

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?

Andrei
  • 7,340
  • 19
  • 71
  • 116

3 Answers3

15

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:

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

Community
  • 1
  • 1
Brad
  • 146,404
  • 44
  • 300
  • 476
12

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:

Pekka
  • 418,526
  • 129
  • 929
  • 1,058
  • Thanks Pekka, How would you then be able to tell the browser to save the value in that 'password' field? – Andrei Oct 23 '10 at 14:00
  • @Andrei the browser will usually offer to auto-save values when encountering "login / password" field combinations. Do you want to *force* auto-saving? Not sure whether that's possible... Except for making it a normal text input – Pekka Oct 23 '10 at 14:03
  • 1
    If you don't add the `autocomplete='off'` bit the browser will try to save it – Jimmy Oct 23 '10 at 14:04
  • @Pekka, how would you save a combination of username and password, without giving the type of one to 'password'? – Andrei Oct 23 '10 at 14:12
  • @Andrei hmmm.... sounds difficult. Maybe with some JavaScript trickery.... You want the password to be visible, and the combination to be saved in the browser? That is awfully insecure - you could as well save the password in a cookie in that case. What is your ultimate goal here? – Pekka Oct 23 '10 at 14:13
  • @Pekka http://stackoverflow.com/questions/4004400/html-css-js-how-to-force-browser-to-save-password-from-a-non-password-type-inp – Andrei Oct 23 '10 at 14:14
  • 1
    @Andrei all right, I'll think about it and if I have an idea, I'll post it there – Pekka Oct 23 '10 at 14:15
3

Then is it called password?It is simple text box only.

<input type="text" name="password" id="password" />

Edit: Whether you want like a remember my password?

So if you want to keep the password in the client side then put it in the cookie and if cookie already set replace the password field with cookie value.

Mo.
  • 21,971
  • 31
  • 138
  • 201
svk
  • 4,205
  • 16
  • 56
  • 97