autocomplete = "off" и autocomplete = "nope" не работает на Chrome - PullRequest
1 голос
/ 25 марта 2019

автозаполнение не работает.Я пробовал autocomplete="off", autocomplete="nope" и autocomplete="false".Все еще пароль и имя пользователя отображаются в текстовом поле ввода

@Html.EditorFor(model => model.CustomerPasswordVM.OldPassword, new { htmlAttributes = new { @class = "form-control" } })

Ответы [ 2 ]

0 голосов
/ 25 марта 2019

Я тоже столкнулся с той же проблемой, мне помог код ниже.

  @Html.EditorFor(model => model.CustomerPasswordVM.OldPassword, new { htmlAttributes = new { @class = "form-control", @readonly= "readonly", @onfocus = "this.removeAttribute('readonly');" } })
0 голосов
/ 25 марта 2019

От: 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.

Может ли это быть вашей проблемой?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...