How do I suppress firefox password field completion?

10,826

Solution 1

From Mozilla's documentation

<form name="form1" id="form1" method="post" autocomplete="off"
  action="http://www.example.com/form.cgi">
[...]
</form>

http://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion

Solution 2

The autocomplete="off" method doesn't work for me. I realized firefox was injecting the saved password in the first password field it encountered, so the solution that worked for me was to create a dummy password field before the password update field and hide it. Like so:

<input type="password" style="display: none;" />
<input type="password" name="password_update" />

Solution 3

Have you tried adding the autocomplete="off" attribute in the input tag? Not sure if it'll work, but it is worth a try.

Share:
10,826

Related videos on Youtube

Christian Oudard
Author by

Christian Oudard

My programming interests include web development, databases, algorithms, AI, and optimization. My favorite language is Python.

Updated on April 17, 2022

Comments

  • Christian Oudard
    Christian Oudard about 2 years

    I'm developing a website. I'm using a single-page web-app style, so all of the different parts of the site are AJAX'd into index.php. When a user logs in and tells Firefox to remember his username and password, all input boxes on the site get auto-filled with that username and password. This is a problem on the form to change a password. How can i prevent Firefox from automatically filling out these fields? I already tried giving them different names and ids.

    Edit: Someone has already asked this. Thanks Joel Coohorn.

  • Christian Oudard
    Christian Oudard over 15 years
    I agree about the bookmarking and back button, but it's not my choice :(
  • BoCyrill
    BoCyrill over 7 years
    That did not work for me. But the following answer worked for me http://stackoverflow.com/a/26156376/4601322
  • LeO
    LeO over 6 years
    The hidden field is quite nice although its for FF only. Still the only solution if working with Angular. The web-docu does not work :-/