How do I prevent auto complete "Use password for:" option in chrome?
In IE you need to do like this:
<asp:TextBox ID="TextBoxPassword" runat="server" AutoCompleteType="Disabled"></asp:TextBox>
In all other browsers, this:
<asp:TextBox ID="TextBoxPassword" runat="server" autocomplete="Off"></asp:TextBox>
Im pretty sure you need the 'off' to be: 'Off'
In HTML, as you mention you can use the;
<form action="demo_form.asp" autocomplete="on"> First name:<input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> E-mail: <input type="email" name="email" autocomplete="off"><br> <input type="submit"></form
Either on the form or the input itself.
Maybe something else in your code is enabling it again?
Hope this works. Just tested and had no problem. Both IE and Chrome.
For me, none of those solved the issue. I found two workaround which solves it.
First, Chrome / FF / IE omits set autocomplete info to fields set to readonly,Second, also omits when the field(s) have init value != empty.
So, you need to setting the form fields to read only and then removing the attribute once the user focus them (can be done with Javascript, or programatically in code behind).
For example, in simple html:
<input readonly="readonly" onfocus="this.removeAttribute('readonly');" type="text" value="stored@domain.com">
In html-aspx:
<asp:TextBox runat="server" ID="TxtEmployeId" ReadOnly="true" MaxLength="100"/>
Alternatively / additionally, you can set a fixed value for the field (in the numeric field case, you can set to 0).
if (!Page.IsPostBack) { TxtEmployeId.Text = "@"; }
I know this solution is not confortable at all, for each field / page you have with the problem you need to apply this. But it works :)