如何防止浏览器缓存表单字段? [英] How to prevent browser from caching form fields?

查看:15
本文介绍了如何防止浏览器缓存表单字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用户填充的表单字段中有一个 textbox.但是目前(在 Firefox 10 中)用户可以离开页面,然后返回,并且输入将填充其先前的值.我认为这会造成令人困惑的用户体验,并希望防止这种情况发生.

I have a textbox in a form field that gets populated by the user. However currently (in Firefox 10) the user can navigate away from the page, then come back, and the input will be populated with its previous value. I think this creates for a confusing user experience, and would like to prevent it.

有没有办法在不手动重置值的情况下做到这一点?我尝试将响应更改为不缓存以及设置 autocomplete='false',但没有成功.

Is there a way to do this without manually resetting the value? I have tried changing the response to not cache as well as setting autocomplete='false' with no luck.

推荐答案

尝试使用 autocomplete="off",但不适用于所有浏览器

Try with autocomplete="off", but it will not work with all browsers

PS:重复...

阻止浏览器向文本框填充详细信息

制作页面告诉浏览器不要缓存/保留输入值

这篇关于如何防止浏览器缓存表单字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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