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.
From Mozilla’s documentation
<form name="form1" id="form1" method="post" autocomplete="off" action="http://www.example.com/form.cgi"> [...] </form>
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" />
Have you tried adding the autocomplete=”off” attribute in the input tag? Not sure if it’ll work, but it is worth a try.
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?