Is autocomplete=“off” compatible with all modern b

2019-01-01 13:20发布

I've just been given a requirement to prevent browsers from saving data entered into specific form fields. It's been years since I've done web dev, and this is a relatively new capability. I was able to find the form field property autocomplete="off", but I can't seem to find any documentation indicating which browsers support it. Can anyone point me in the right direction of a chart of form attributes and browser compatibility?

标签: html forms
7条回答
步步皆殇っ
2楼-- · 2019-01-01 14:01

Matter of fact, both username and password fields doesn't react to AutoComplete=off in all the latest browsers.

查看更多
梦寄多情
3楼-- · 2019-01-01 14:05

If you're able to use JavaScript and jQuery, you can place this on load of the html:

$('#theform input').val('');
查看更多
何处买醉
4楼-- · 2019-01-01 14:09

Be aware that all major browsers are moving towards ignoring the attribute for password fields.

I can only offer anecdotal evidence, but I've yet to come across a browser that fails to respect autocomplete="off", this experience covers:

  • Firefox 1.5+ (Windows and Ubuntu)
  • Opera 6+ (Windows and Ubuntu)
  • Chrome v2+ (Windows and Ubuntu)
  • Epiphany 0.8 (ish) (Ubuntu)
  • Midori (I can't remember which version)
  • Safari v1+ (Windows)
  • IE 4 - 8, Windows.

I'm aware that Greasemonkey scripts, and presumably other user-scripts, can disable the autocomplete setting.

There's a couple of articles I found that might be useful to you:

  1. How to turn off form auto-completion
  2. Using auto-complete in html forms
查看更多
呛了眼睛熬了心
5楼-- · 2019-01-01 14:12

Password managers now ignore the autocomplete attribute for password fields in the major browsers as of:

It should still work fine for disabling autocomplete on form fields, but no longer affects the password manager.

查看更多
何处买醉
6楼-- · 2019-01-01 14:12

As of Chrome v34, autocomplete="off" is now ignored by default.

This somewhat debatable feature can be disabled in the flags configuration by visiting chrome://flags

http://news.softpedia.com/news/Chrome-34-Seeks-to-Save-All-Your-Passwords-436693.shtml

查看更多
谁念西风独自凉
7楼-- · 2019-01-01 14:12

Some solution is not working in modern browsers.

Another solution link is given here. which works in all modern browsers.

Input type=password, don't let browser remember the password

You can use autocomplete="off" in this given soluton

查看更多
登录 后发表回答