简体   繁体   English

防止Firefox自动完成弹出

[英]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.

相关问题 如何防止 Firefox 的站内搜索弹出? - How to prevent Firefox' in-site-search from popping up? 防止键盘在 datepicker mobile 上弹出 - prevent keyboard from popping up on datepicker mobile 如何防止野生动物园弹出密码保存框? - How to prevent safari from popping up a password saving box? 如何防止键盘在移动设备上弹出? - How to prevent the keyboard from popping up on mobile devices? 防止在休假时弹出“确认导航”对话框 - Prevent the “Confirm Navigation” dialog box from popping up on page leave 如何在 Firefox 中使用 html/javascript 禁用斜杠和撇号键弹出快速查找? - How do I disable the slash and apostrophe keys from popping up quick find in Firefox with html/javascript? 从控制器返回时,MVC5防止弹出模式窗口 - MVC5 prevent modal window from popping up when returning from controller 提交联系表格后如何防止PHP文件弹出? - How do I prevent PHP file from popping up after submitting contact form? 如何防止 jQuery datepicker 在初始页面加载时弹出但仍滚动到 datepicker 文本框 - How to prevent jQuery datepicker from popping up on initial page load but still scroll to datepicker textbox 如何取消/阻止PayPal的结帐模式在满足条件之前弹出? - How to cancel / prevent PayPal's checkout modal from popping up before a condition is met?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM