Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 920
Simon Johnson Avatar asked Apr 26 '10 16:04

Simon Johnson


2 Answers

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.

like image 100
Juha Syrjälä Avatar answered Sep 22 '22 15:09

Juha Syrjälä


<asp:TextBox Runat="server" ID="Textbox1" autocomplete="off"></asp:TextBox>
like image 44
Kobi Avatar answered Sep 20 '22 15:09

Kobi