Stop browser from filling textboxes with details

China☆狼群 提交于 2019-11-27 21:18:55
  <input type="text" name="Username" autocomplete="off">

You can also put this on the form tag. Note this does not work consistently in all browsers.

The only solution that worked for me was to include two fields, one for login and one for the password with display: none <input type="text" style="display: none"> <input type="password" style="display: none">

<asp:TextBox ID="Text1" runat="server" AutoCompleteType="Disabled"></asp:TextBox>

If you happen to work in a much more updated framework, this code should work as expected. It has been 8 years ago and some of the answers here is outdated.

if you set autocomplete="off"... the textbox will loose every words on its history... but if you want to prevent browser saved usernames and password, the best way is to put these tags in top of your page:

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