How do you disable autocomplete
in the major browsers for a specific input
(or form field
)?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
try these too if just
autocomplete="off"
doesn't work:Just set
autocomplete="off"
. There is a very good reason for doing this: You want to provide your own autocomplete functionality!I've solved the endless fight with Google Chrome with the use of random characters.
Hope that it will help to other people.
The solution for Chrome is to add
autocomplete="new-password"
to the input type password.Example:
Chrome always autocomplete the data if it finds a box of type password, just enough to indicate for that box
autocomplete = "new-password"
.Note: make sure with F12 that your changes take effect, many times browsers save the page in cache, this gave me a bad impression that it did not work, but the browser did not actually bring the changes.
None of the solutions worked for me in this conversation.
I finally figured out a pure HTML solution that requires no Javascript, works in modern browsers (except IE; there had to at least 1 catch, right?), and does not require you to disable autocomplete for the entire form.
Simply turn off autocomplete on the
form
and then turn it ON for anyinput
you wish it to work within the form. For example:None of the hacks mentioned here worked for me in Chrome. There's a discussion of the issue here: https://code.google.com/p/chromium/issues/detail?id=468153#c41
Adding this inside a
<form>
works (at least for now):