Currently, when the user is loggged out, on user login form, the username field is filled with text, which probably is taken from a cookie (not sure) - it is the name of someone who logged in before. The password is also filled with dots, representing previously logged in password.

How to prevent it, i.e. always display username and password fields empty?

P.S. Why I need this? Because the requirement is that in the user name box there is a placeholder behavior with text "Username". (HTML5 placeholder). I noticed that it works well when the browser has no username remembered and does not work at all when the browser remembers the username and password.

  • Some browsers will remember your login information for specific forms. Maybe something like this is happening? If that's the case then this isn't a Drupal problem. Commented Oct 2, 2012 at 15:27

3 Answers 3


Clear your browser cache, and make sure you don't have any accounts set to be "Remembered".

  • I wanted to do it globally, so that the username and password never appear as a hint on this site, regardless of user browser cache settings. I've seen such behavior on some sites that they never remembers my login credentials and it makes me upset personally, but in this case it's a request, for this particular site. What do you mean by "accounts set to be remembered", is there such setting in Drupal ?
    – camcam
    Commented Oct 2, 2012 at 18:56
  • Ops, I think the "accounts to be remembered" is a browser option.. my Chrome remembers something because 1) it is in yellow background in the textbox and 2) it is nonsense because even instead of Drupal username it just "remembers" my e-mail in this box.. strange and just wrong.
    – camcam
    Commented Oct 2, 2012 at 19:17
  • Yes, the accounts to be remembered section is a Browser option. I don't think there is an option to disable this browser function through drupal. Commented Oct 2, 2012 at 21:08

Usually, it's the browser that remembers login names and passwords, allthough some sites place a cookie upon successful login that they use to populate the username field on your next visit.

I don't think Drupal does this by default so I think in your case, it's the browser that remembers the login name and password.

There is one way to avoid this and that's by changing the name of the form fields. Browsers 'know' to remember usernames because the name of those fields is usually something like 'user', 'username' or 'login'.

If you change the name attrribute of the login input field to, say, 'bycicle', browsers will stop remembering those values automatically.


Set Autocomplete=off at both username and password input fields.

ex: <input type=text id=uname Autocomplete=off>
    <input type=password id=pword Autocomplete=off>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.