Disable auto fill of input tag in html? [duplicate]

好久不见. 提交于 2021-01-28 01:04:18

问题


I have a webpage taking a new user name & password as input. For scripting, I am using AngularJS.

<div class="form-group">
 <input ng-model="prc.userName" placeholder="User Name" type="text" class="form-control" autocomplete="nope" required autofocus />
</div>

This input box always gets auto-filled, I don't want it to get auto-filled.

Question reviewed prior: How do you disable browser Autocomplete on web form field / input tag?

// These attributes do not work
autocomplete="off"
autocomplete="false"

My chrome version: Version 73.0.3683.103 (Official Build) (64-bit)

How can I do that?


回答1:


Yes this is a known error and it can be really annoying. for some reason autocomplete='false' and autocomplete='off' aren't working at all in chrome.

The only known method to get rid of it is to use autocomplete='new-password', this will deactivate the autocomplete!

Cheers




回答2:


Add autocomplete="off" onto (form) element;

Add hidden (input) with autocomplete="false" as a first children element of the form.



来源:https://stackoverflow.com/questions/55866283/disable-auto-fill-of-input-tag-in-html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!