How can we disable Chrome's autofill feature on certain <input>
s to prevent them from being automatically populated when the page loads?
At the same time I need to keep autocomplete enabled, so the user can still see the list of suggestions by clicking on the input or typing in it. Can this be done?
EDIT: Feel free to use plain Javascript or jQuery if you feel it is necessary or you feel like it would make your solution simpler.
Add autocomplete="off" onto <form> element; Add hidden <input> with autocomplete="false" as a first children element of the form.
Click the Display tab. Do one of the following: To enable AutoComplete for the text box, select the Enable AutoComplete check box. To disable AutoComplete for the text box, clear the Enable AutoComplete check box.
Then, when the unwanted autocomplete suggestion appears, use your keyboard's arrow keys to highlight the suggestion in the drop-down menu below the address bar. Finally, press Shift + Delete and poof! The suggestion disappears. On a Mac, you may have to press Shift + Fn + Delete .
Here's the magic you want:
autocomplete="new-password"
Chrome intentionally ignores autocomplete="off"
and autocomplete="false"
. However, they put new-password
in as a special clause to stop new password forms from being auto-filled.
I put the above line in my password input, and now I can edit other fields in my form and the password is not auto-filled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With