autocomplete =“ off”和autocomplete =“ nope”在chrome上不起作用

时间:2019-03-25 12:38:04

标签: asp.net-mvc html5

自动完成功能不起作用。我尝试了Learner***008888 autocomplete="off"autocomplete="nope"。静止密码和用户名显示在输入文本框中

autocomplete="false"

4 个答案:

答案 0 :(得分:0)

发件人:https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

"off"
The browser is not permitted to automatically enter or select a value for this field.
It is possible that the document or application provides its own autocomplete feature,
or that security concerns require that the field's value not be
automatically entered.

    Note: In most modern browsers, setting autocomplete to "off" will not
prevent a password manager from asking the user if they would like to save
username and password information, or from automatically filling in those
values in a site's login form. See the autocomplete attribute and login 
fields.

这可能是您的问题吗?

答案 1 :(得分:0)

我也面临同样的问题,下面的代码帮助了我。

  @Html.EditorFor(model => model.CustomerPasswordVM.OldPassword, new { htmlAttributes = new { @class = "form-control", @readonly= "readonly", @onfocus = "this.removeAttribute('readonly');" } })

答案 2 :(得分:0)

此处与自动完成无关。您会在相应的文本框中看到用户名和密码选项,因为您已将其保存并要求Chrome记住密码。这是Google新实施的功能,首次尝试时会显示密码。该功能最近在Chrome中得到了增强。

答案 3 :(得分:0)

尝试改用 autocomplete="new-password"。