Chrome Browser Ignoring AutoComplete=Off

I've created a web application which uses a tagbox drop down, this works great in all browsers except my preferred browser Chrome (Version 21.0.1180.89).

Despite both the input field AND the form field having the autocomplete="off" attribute, Chrome insists on showing a drop down history of previous entries for the field, which is obliterating the tagbox list.


In my experience, Chrome only autocompletes the first <input type="password"> and the previous <input> . So I added:

<input style="display:none">
<input type="password" style="display:none">

To the top of the <form> and the case was resolved.

UPDATE

It seems now chrome ignore tag style="display:none" or "visibility: hidden;"

you change to something like

<input style="opacity: 0;position: absolute;">
<input type="password" style="opacity: 0;position: absolute;">

The best solution:

Prevent autocomplete username (or email) and password:

<input type="email" name="email"><!-- Can be type="text" -->
<input type="password" name="password" autocomplete="new-password">

Prevent autocomplete a field:

<input type="text" name="field" autocomplete="nope">

Explanation: autocomplete continues work in <input> , autocomplete="off" does not work, but you can change off to a random string, like nope .

Works in:

  • Chrome: 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 and 64

  • Firefox: 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 and 58


  • Chrome似乎忽略了autocomplete="off"除非它位于<form autocomplete="off">标签上。

    链接地址: http://www.djcxy.com/p/41784.html

    上一篇: 使用mediaElement时,来自MediaPlayer的WP7无间隙音乐

    下一篇: Chrome浏览器忽略自动完成=关闭