1

Chrome 72.0 not working autocomplete text

<input placeholder="" name="uname" type="text" style="display: none;">

<input class="form-control" placeholder="" name="uname" type="text" id="uname">

Any other solution for latest chrome 72.0?

2 Answers2

0

Set autocomplete to on and set the name of the input:

<input autocomplete="on" name="inputName">
0

Chrome doesn't really want you to prevent autofill. It intentionally ignores any attempts to disable autocomplete.

But of course, there are some hacks. You can set such fields to readonly, and remove the attribute on either page load or focus. Check this answer.

If you prefer a non-js solution, you can also add extra input elements to the form, and make them disappear with something like;

position:absolute;top:-99999px;left:-99999px;

Yes, this is a dirty hack. But the old solution (using display:none) is not enough to cheat chrome anymore.

Gökhan Mete ERTÜRK
  • 3,378
  • 2
  • 19
  • 23