I\'ve created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).
Despite both the
After the chrome v. 34, setting autocomplete="off"
at <form>
tag doesn`t work
I made the changes to avoid this annoying behavior:
name
and the id
of the password inputpasswordInput
)(So far, Chrome wont put the saved password on the input, but the form is now broken)
Finally, to make the form work, put this code to run when the user click the submit button, or whenever you want to trigger the form submittion:
var sI = $(".passwordInput")[0];
$(sI).attr("id", "password");
$(sI).attr("name", "password");
In my case, I used to hav id="password" name="password"
in the password input, so I put them back before trigger the submition.
Simply make your input readonly
, and on focus, remove it. This is a very simple approach and browsers will not populate readonly
inputs. Therefore, this method is accepted and will never be overwritten by future browser updates.
<input type="text" onfocus="this.removeAttribute('readonly');" readonly />
The next part is optional. Style your input accordingly so that it does not look like a readonly
input.
input[readonly] {
cursor: text;
background-color: #fff;
}
WORKING EXAMPLE
Change input type attribute to type="search"
.
Google doesn't apply auto-fill to inputs with a type of search.
I had a similar issue where the input field took either a name or an email. I set autocomplete="off" but Chrome still forced suggestions. Turns out it was because the placeholder text had the words "name" and "email" in it.
For example
<input type="text" placeholder="name or email" autocomplete="off" />
I got around it by putting a zero width space into the words in the placeholder. No more Chrome autocomplete.
<input type="text" placeholder="nam​e or emai​l" autocomplete="off" />
Chrome version 34 now ignores the autocomplete=off
,
see this.
Lots of discussion on whether this is a good thing or a bad thing? Whats your views?
You can use autocomplete="new-password"
<input type="email" name="email">
<input type="password" name="password" autocomplete="new-password">
Works in: