Modern browsers with a built-in password manager ignore autocomplete="off" in login forms (usually this is a form with <input type="password"> ). When the end user registers for the first time through this form, the browser asks the end user whether to remember the login for this site or not. If the end user selects No, the default behavior will continue (therefore, the autocomplete attribute will be respected regardless of its value). However, if the end user selects Yes, the default behavior will be overridden, and it will behave as if autocomplete always on. This is the browser configuration option that is enabled by default. It is also mentioned in MDN .
You can get around this by simply using Ajax to submit the form. In other words, instead of using the synchronous HTML POST form βplain vanillaβ, use XMLHttpRequest (if necessary indirectly, for example, jQuery or the equivalent). Current browsers do not recognize the login via Ajax and therefore will not ask the end user to remember the login.
If your web infrastructure does not offer built-in Ajax tools, consider throwing in jQuery . Then we are talking about the bottom lines to unobtrusively improve the existing form. The following example of a basic launch assumes that you have redesigned the server side to return text as true or false as an answer, depending on whether the input was successful or not. If necessary, you can conditionally answer depending on the value of the X-Requested-With header:
$(document).on("submit", "#loginFormId", function() { var $form = $(this); $.post($form.attr("action"), $form.serialize(), function(response) { if (response) { window.location = "home.html";
source share