When typing in HTML forms, browsers like Firefox or Internet Explorer store the values, sometimes quietly. So when typing in another webforms, the browser smartly suggest the same information. Another method to show the dropdown list is double-clicking an empty textbox.
On an E-commerce website, the customer types the credit card number, and another sensitive information. How I do to avoid or block the browser to store that sensitive information?
Another worry is about tampered form data stored (by malware, by example). Then the customer can select this contaminated data and compromise the site.
Try with the atribute autocomplete="off"
It should work for single input elements:
<input type="text" autocomplete="off" name="text1" />
or to the entire form:
<form name="form1" id="form1" method="post" autocomplete="off"
action="http://www.example.com/action">
[...]
</form>
And specifically for ASP .NET you can set it like this:
The WebForms form:
<form id="Form1" method="post" runat="server" autocomplete="off">
Textboxes:
<asp:TextBox Runat="server" ID="Textbox1" autocomplete="off"></asp:TextBox>
or at runtime:
Textbox1.Attributes.Add("autocomplete", "off");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With