Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
851 views
in Technique[技术] by (71.8m points)

asp.net - autocomplete="off" not working for Google Chrome

This question has been asked Several times in the past but unfortunately there's no way i could disable autofill for Google Chrome (v.36.0.1985.125 m)

I have already Tried

"AutoComplete=Off" not working on Google Chrome Browser

How do I stop Chrome from pre-populating input boxes?

how to disable google chrome suggestion list when using twitter bootstrap typeahead?

Code tested so far

<form autocomplete="off">

<asp:textbox autocomplete="off">

AutoCompleteType="Disabled"

But I still get autofiled data on my login page. Passwords are populated even if Textbox Ids are changed.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Since I have been having this very same issue and it seems all "alternatives" stopped working as the browsers have been getting recent updates, I came across a "dirty" solution that baffled me completely.

If we go on each field we want to disable the autocomplete feature and set its autocomplete attribute to an invalid value (only "off" and "on" are valid), the browser will stop trying to autofill those fields because of that.

Surprised? So was I!

Example:

<input type="text" autocomplete="stopdoingthat" />

And apparently it works. Stupid, I know, but it's a "dirty" one that actually works for now.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...