问题
I have an input field on a webpage that contains a credit-card number. What is the best way of preventing the browser from caching this value?
Any solution needs to work on a large selection of browsers.
回答1:
Put attribute autocomplete="off"
to your html form. E.g.
<form name="form1" id="form1" method="post" autocomplete="off"
action="http://www.example.com/form.cgi">
[...]
</form>
See this page.
回答2:
<asp:TextBox Runat="server" ID="Textbox1" autocomplete="off"></asp:TextBox>
来源:https://stackoverflow.com/questions/2715171/how-to-prevent-the-credit-card-number-field-being-cached-by-the-browser