How to prevent the credit-card number field being cached by the browser

China☆狼群 提交于 2019-12-22 05:29:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!