Is there any way to disable autocomplete on a text field in chrome 66? I have tried a number of options like :
- autocomplete="off"
- autocomplete="false"
- autocomplete="disabled"
- autocomplete="something-new" etc.
Can anyone help me with this?
Also, one more thing does chrome automatically enables autocomplete for a username if it has a password type field below it?
7 Answers
Answers 1
I used this code and it is working for me. I hope it will also helpful for you. :) Enter your type with readonly and then below mention code.
<input readonly type="email" onfocus="if (this.hasAttribute('readonly')) { this.removeAttribute('readonly'); this.blur(); this.focus(); }" />
Answers 2
Use this
$(document).ready(function(){ $("input").attr("autocomplete", "off"); });
And if the autofill is enabled in chrome you can follow these steps to turn it off:
Turning Off Autofill in Chrome
- Click the Chrome menu icon. (Three lines at the top right of your screen.)
- Click on Settings.
- At the bottom of the page, click “Show Advanced Settings”
- In the Passwords and Forms section, uncheck “Enable Autofill to fill out web forms in a single click”
Answers 3
A lot of browsers refuse to adhere to what you have mentioned - the best way is to make an element readonly
and then on hover/click/blur/focus, remove readonly
.
So you could give it a class such as disable_autocomplete and also make the input field readonly.
Then when the field is hovered, focussed, or clicked you can remove readonly. Optionally, add it back when unfocussed.
Answers 4
$(document).ready(function(){ $("input").val(""); });
So, Chrome just sets the value of element when autofilling them. Just try that, else you can try set some interval, wich will check value in HTML code, because Chrome not put new value to HTML code, just puts it in memory for itself.
Answers 5
try this its work in form tag write your html and desings
Answers 6
maybe try
autocomplete="new-password"
Answers 7
autocomplete="nada"
Tested on Chrome 66 (Windows PC), works OK. Using any values other than "nada" seems to work too, like "nope".
0 comments:
Post a Comment