How to stop Chrome from autocompleting text areas? How to stop Chrome from autocompleting text areas? google-chrome google-chrome

How to stop Chrome from autocompleting text areas?


Answering my own question since I did not find the answer on Stack or in any Chrome browser docs.

In some cases, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really forcing the no-autocompletion is to assign a random string to the attribute, for example:

autocomplete="nope"

Since this random value is not a valid one, the browser will give up.

https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion


I tried all the suggestions and nothing really worked consistently.

If I set one input to autocomplete="nope" it works.

If I set two or more it breaks them all.

If I set two to autocomplete="nope" and autocomplete="no" it works on those two but breaks again if I do anything to a 3rd.

My form only has 3 inputs. I just set email and phone and left name alone. That pretty much solves my problem.

I have some jquery validation that pretty much does not work with autocomplete and this client really does not want to be bothered with junk emails.

Also Chrome treats a one row textarea exactly the same as a input.