How to disable browser prompt to remember the pass

2019-08-10 19:44发布

问题:

I have to disable browser prompt to remember the password on login form, I have tried AUTOCOMPLETE="OFF" but it doesn't work

回答1:

Can you please share your code. Especially that password tag.

I have faced the same problem. But this has fixed by below code.

    @Html.TextBoxFor(m => m.Password, new { @id ="Password", @Placeholder = "Password", @type = "Password", @required = "required", @Value = "", @autocomplete = "off" })


回答2:

Try this HTML:

<input type="text" name="password" required autocomplete="off">

and JS:

function validate() {
    $("input[name='password']").attr("type", "password");
}
$('input[name="username"]').on('keyup click', validate);
$('input[name="password"]').on('keyup click', validate);