我该怎么做才能强制浏览器不存储在HTML表单字段的数据? [英] How I do to force the browser to not store the html form field data?

查看:300
本文介绍了我该怎么做才能强制浏览器不存储在HTML表单字段的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当HTML表单输入,浏览器如火狐或IE存储值,有时静静地。因此,在另一个web表单打字时,在浏览器巧妙建议相同的信息。显示下拉列表中的另一种方法是双击一个空的文本框。

When typing in html forms, browsers like firefox or ie 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.

在一个电子商务网站,客户输入信用卡号码,另一个敏感信息。我该怎么做,以避免或阻止浏览器来存储敏感信息?

In a e-commerce website, the customer type 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 a malware, by example). Then the customer can select this contaminated data and compromise the site.

问候。

推荐答案

尝试使用属性附加伤害自动完成=关闭

Try with the atribute autocomplete="off"

应该单输入元素工作:

<input type="text" autocomplete="off" name="text1" />

或整个表单:

<form name="form1" id="form1" method="post" autocomplete="off"
  action="http://www.example.com/action">
[...]
</form>

和专门为 ASP .NET 您可以将其设置是这样的:

And specifically for ASP .NET you can set it like this:

在WebForms的形成:

The WebForms form:

<form id="Form1" method="post" runat="server" autocomplete="off">

文本框:

<asp:TextBox Runat="server" ID="Textbox1" autocomplete="off"></asp:TextBox>

或者在运行时:

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

这篇关于我该怎么做才能强制浏览器不存储在HTML表单字段的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆