Is it possible to disable autocomplete?

不羁岁月 提交于 2019-12-10 14:07:03

问题


I know i shouldnt do it but it may be easier then explaining to the clients that you should do it through the browser. They have a public computer and a server running on the machine in an admin account (the code i am writing). They want people to enter their information but they dont want someone pressing down on the email input box to display ppls email address. Is there a way i can disable this through code in IE? (i believe they are using 6 but they may use 7 or 8).


回答1:


Use the non-standard autocomplete attribute:

autocomplete="off"

Works in all modern browsers. Will break HTML 4 validation, though. No way around that. Will be valid in HTML 5.

Reference:

  • Mozilla: How to Turn Off Form Autocompletion

  • IE: Using AutoComplete in HTML Forms




回答2:


<input name="name" autocomplete="off">


来源:https://stackoverflow.com/questions/3730601/is-it-possible-to-disable-autocomplete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!