禁用文本输入历史记录 [英] disable text input history
本文介绍了禁用文本输入历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Possible Duplicate:
How do you disable browser Autocomplete on web form field / input tag?
我正在构建一个将接受信用卡数据的应用程序.我想确保浏览器不会记住信用卡号文本输入中输入的内容.我尝试传递以下标头:
I am building an application which will be accepting credit card data. I would like to make sure that the browser does NOT remember what has been type into the text inputs for credit card number. I tried passing the following headers:
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
仍然,页面重新加载后,我可以单击信用卡文本输入字段,它会让我看到我之前写的内容.我该如何预防?
Still, once the page reloads, I can click the credit card text input field and it will let me see what I wrote in it before. How can I prevent this?
推荐答案
<input type="text" autocomplete="off"/>
应该工作.或者,使用:
Should work. Alternatively, use:
<form autocomplete="off" … >
有关整个表格(请参见此相关问题).
for the entire form (see this related question).
这篇关于禁用文本输入历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文