Sunday, March 11, 2012

Deactivate browser based autocomplete

A google search for 'disable firefox autocomplete' found this:http://javascript.weblogsinc.com/2004/11/25/disabling-autocomplete-in-forms/ on the first page of results.


For Asp.net Text Box use the following:

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

For Regular HTML Text Box:

<input type="text" id="Text1" autocomplete="off" />

Thanks for the answers, but... unfortunately they don't work for me. I don't know, why. I used AutoCompleteType="Disabled"/="None", and I also tried the solution provided by Chris Holland (javascript). Nothing. FF autocompletion is still activated.

I figured out, that the autocomplete attribute isn't rendered, no matter which value I assigned to it.


Hi Hendrik

I'm afraid this is not a AJAX issue,May you post it to any forums about Firefox?And I'll make this issue as "Resolved".

Thank you.


you are right, the AutoCompleteType property does not render to the corresponding AUTOCOMPLETE html property.

you can fix this by adding the following line inside the page's Load event:

YOUR_TEXTBOX_CONTROL.Attributes.Add("autocomplete","off");

(btw, you can turn off FF auto completion by unchecking the "Remember what I enter in forms and the search bar" option under Tools -> Options -> Privacy.)



dpant:

[...]adding the following line inside the page's Load event:

YOUR_TEXTBOX_CONTROL.Attributes.Add("autocomplete","off");


@.dpant: That helped! Thanks a lot!Big Smile

@.Jin-thingamajig: that reallydidn't help... you wasted your breath.


I was just looking for an answer to this exact same issue :)

Just wanted to add that you dont need to do that in the page load. You can just go into the html and put AutoComplete="Off" and it works fine. I prefer doing that since that seems more straight forward then doing it in the page load.

No comments:

Post a Comment