我怎样才能防止Firefox的自动完成? [英] How can I prevent Firefox's Autocomplete?

查看:179
本文介绍了我怎样才能防止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.

有什么办法可以防止Firefox做到这一点?

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.

推荐答案

在表单标签中添加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天全站免登陆