简体   繁体   English

停用Chrome中的自动填充表单输入

[英]Disable autofill form inputs in chrome

Any one have an idea how to disable auto fill in chrome 任何人都有一个想法如何禁用Chrome自动填充

I have used for sure $("#my_input").val() it works fine with Firefox but not Chrome 我已经确定$("#my_input").val()可以在Firefox正常工作,但不能在Chrome

I have used jquery $("#form").disableAutoFill() autocomplete="off" 我已经使用了jquery $("#form").disableAutoFill() autocomplete="off"

any suggestions 有什么建议么

Not just removing from the input , i want aswell no suggestions from chrome 不只是从输入中删除,我也希望chrome no suggestions

To disable Chrome autofill and suggestions in items which have a valid autofill value such as name or email, add autocomplete="nope". 要在具有有效自动填充值的项目(例如名称或电子邮件)中禁用Chrome自动填充和建议,请添加autocomplete =“ nope”。

<input type="text" autocomplete="nope" name="email"> 

In cases where you have previously saved values that are showing dropdown suggestions, for example in a column of numbers in an accounting page, use JS to change the names of the inputs. 如果您以前保存了显示下拉建议的值(例如,在会计页面的数字列中),请使用JS更改输入的名称。

<input type="text" data-name="my_inputname">

An example of how you would do this with jQuery: https://codepen.io/btn-ninja/pen/EBmNQb 有关如何使用jQuery的示例: https : //codepen.io/btn-ninja/pen/EBmNQb

In cases where you want the autocomplete to work, here is documentation on valid autocomplete values: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete 如果您希望自动完成功能起作用,以下是有关有效自动完成值的文档: https : //developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM