1

I am trying to disable Chrome version 84 autofill from one of my form fields and I have many methods which none seem to work:

I have tried these:

<!-- setting autocomplete to random value other than on or off -->
<input autocomplete="xyz" type="text"/>

<!-- setting autocomplete to random value other than on or off in form and input -->
<form autocomplete="xyz">
<input autocomplete="xyz" type="text"/>
</form>

<!-- setting autocomplete to chrome-off -->
<input autocomplete="chrome-off" type="text"/>

I have also tried creating hidden elements as well to "trick" Chrome but I wasn't able to do that. I have done all methods mentioned in these posts:

Autocomplete off vs false?

Chrome ignores autocomplete="off"

I am out of options am I missing something?

doğukan
  • 14,001
  • 6
  • 27
  • 47
ashes999
  • 697
  • 3
  • 10

1 Answers1

1

I have found a solution which seems opposite of has been recommended although I do not know if this will be the case for everyone:

<!-- simply set the type to search and then set autocomplete to off -->
<input type="search" autocomplete="off"/>

If you wish to remove the x as well for the input field you can do:

input[type=search]::-ms-clear {  display: none; width : 0; height: 0; }
input[type=search]::-ms-reveal {  display: none; width : 0; height: 0; }

/* clears the 'X' from Chrome */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { display: none; }

Resource: https://blog.maximerouiller.com/post/remove-the-x-from-internet-explorer-and-chrome-input-type-search/

ashes999
  • 697
  • 3
  • 10