如何阻止 Firefox 的自动完成? [英] How can I prevent Firefox's Autocomplete?

查看:25
本文介绍了如何阻止 Firefox 的自动完成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们网站的几个部分需要用户输入一些信息,当页面加载时 Firefox 的自动填充会接管 - 大部分是错误的!

There's several section of our site where the user needs to enter some information, and Firefox's auto fill takes over when the page loads - mostly incorrectly!

例如,有一个传真号码"字段,对于某些用户,Firefox 会不断填写他们的电子邮件地址.如果他们没有看到这一点,他们会去提交表单,验证器会向他们抱怨这不是有效的数字格式.

For example, there's a "Fax Number" field that for some users Firefox keeps filling in with their email address. If they don't see this and they go to submit the form out validators complain to them that it isn't a valid number format.

这确实让我们的销售人员担心,因为当他们查看客户页面时,他们有时会看到其中填满了自己的个人信息.

This really has our sales guys worried because when they go to look at a customers page, they sometimes see it filled in with their own personal info.

有什么办法可以阻止 Firefox 这样做吗?

Is there any way to prevent Firefox from doing this?

推荐答案

将 autocomplete="off" 添加到您的表单标签,如 Mozilla 文档 如何关闭表单自动完成

Add autocomplete="off" to your form tag, as documented in the Mozilla document How to Turn Off Form Autocompletion

<form name="form1" id="form1" method="post" autocomplete="off"
  action="http://www.example.com/form.cgi">
[...]
</form>

请务必阅读有关例外和解决方法的部分- 如果表单中有名称或地址字段,浏览器将忽略自动完成属性!

Do read the section on exceptions and workarounds though - the browser will ignore the autocomplete attribute if you have a Name or Address field in the form!

这篇关于如何阻止 Firefox 的自动完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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