禁用文本输入历史记录 [英] disable text input history

查看:96
本文介绍了禁用文本输入历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何在网络上禁用浏览器自动完成功能表单字段/输入标签?

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屋!

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