Home » Html » How do I suppress firefox password field completion?

How do I suppress firefox password field completion?

Posted by: admin January 2, 2018 Leave a comment

Questions:

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.

Answers:

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

Questions:
Answers:

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" />

Questions:
Answers:

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

Questions:
Answers:

are all your input boxes set to type=password? That would do it. One of the things you can do, and I’m not at all sure that this is the best answer is to leave input box as an input type and just use javascript and onkeydown event to place stars in the input box instead of having the browser render it. Firefox won’t pre-fill that.

As an aside, I have had to work on single-page web-apps and I absolutely hate it. Why would you want to take away the user’s ability to bookmark pages? To use the back button?