[英]Prevent Firefox autocompletion from popping up
I wrote an autocompletion script for an input field on a website. 我为网站上的输入字段编写了一个自动完成脚本。 It uses jQuery and works fine.
它使用jQuery并且工作正常。 It should look something like this:
它应该看起来像这样:
autocomplete-1 http://img96.imageshack.us/img96/1994/screenshot1lm.png autocomplete-1 http://img96.imageshack.us/img96/1994/screenshot1lm.png
Unfortunately, Firefox's own autocompletion gets in my way, overlapping some of the results: alt text http://img15.imageshack.us/img15/557/screenshot2ct.png 不幸的是,Firefox自己的自动完成功能阻碍了我的方式,重叠了一些结果: alt text http://img15.imageshack.us/img15/557/screenshot2ct.png
Is is it possible to prevent the Firefox autocompletion field from popping up? 是否可以防止Firefox自动填充字段弹出? (Not only on my machine but for every user of the website)
(不仅在我的机器上,而且在网站的每个用户)
Add autocomplete="off"
attribute to the input element in question. 将
autocomplete="off"
属性添加到相关输入元素。 Eg 例如
<input autocomplete="off">
Also see this document . 另见本文档 。
As BalusC already pointed out, you can use the autocomplete
attribute but you can also add it to the form element so that it affects all elements: 正如BalusC已经指出的那样,您可以使用
autocomplete
属性,但您也可以将其添加到表单元素,以便它影响所有元素:
<form method="post" action="handler.php" autocomplete="off">
Note that this attribute is not part of a standard but most browsers implement it nevertheless. 请注意,此属性不是标准的一部分,但大多数浏览器仍然实现它。
Use autocomplete=off
in the form or input element. 在表单或输入元素中使用
autocomplete=off
。
Mozilla Developer Central: How to Turn Off Form Autocompletion Mozilla开发人员中心:如何关闭表单自动完成
Use autocomplete="off"
. 使用
autocomplete="off"
。 It's not valid HTML-code, but widely adopted in browsers. 它不是有效的HTML代码,而是在浏览器中广泛采用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.