Chrome ignores autocomplete=“off” [duplicate]





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







330
















This question already has an answer here:




  • Disabling Chrome Autofill

    69 answers




I've created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).



Despite both the input fields AND the form field having the autocomplete="off" attribute, Chrome insists on showing a drop down history of previous entries for the field, which is obliterating the tagbox list.










share|improve this question















marked as duplicate by Martijn Pieters Feb 7 at 3:53


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Technically this question was asked about 5 months before the one referenced as "This question already has an answer here". That one is the duplicate as it came after this one.

    – user3071434
    Feb 25 at 18:19




















330
















This question already has an answer here:




  • Disabling Chrome Autofill

    69 answers




I've created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).



Despite both the input fields AND the form field having the autocomplete="off" attribute, Chrome insists on showing a drop down history of previous entries for the field, which is obliterating the tagbox list.










share|improve this question















marked as duplicate by Martijn Pieters Feb 7 at 3:53


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • Technically this question was asked about 5 months before the one referenced as "This question already has an answer here". That one is the duplicate as it came after this one.

    – user3071434
    Feb 25 at 18:19
















330












330








330


77







This question already has an answer here:




  • Disabling Chrome Autofill

    69 answers




I've created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).



Despite both the input fields AND the form field having the autocomplete="off" attribute, Chrome insists on showing a drop down history of previous entries for the field, which is obliterating the tagbox list.










share|improve this question

















This question already has an answer here:




  • Disabling Chrome Autofill

    69 answers




I've created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).



Despite both the input fields AND the form field having the autocomplete="off" attribute, Chrome insists on showing a drop down history of previous entries for the field, which is obliterating the tagbox list.





This question already has an answer here:




  • Disabling Chrome Autofill

    69 answers








html google-chrome autocomplete html-form






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 20:14









TylerH

16.1k105569




16.1k105569










asked Sep 11 '12 at 16:54









Mr FettMr Fett

2,17831518




2,17831518




marked as duplicate by Martijn Pieters Feb 7 at 3:53


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Martijn Pieters Feb 7 at 3:53


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Technically this question was asked about 5 months before the one referenced as "This question already has an answer here". That one is the duplicate as it came after this one.

    – user3071434
    Feb 25 at 18:19





















  • Technically this question was asked about 5 months before the one referenced as "This question already has an answer here". That one is the duplicate as it came after this one.

    – user3071434
    Feb 25 at 18:19



















Technically this question was asked about 5 months before the one referenced as "This question already has an answer here". That one is the duplicate as it came after this one.

– user3071434
Feb 25 at 18:19







Technically this question was asked about 5 months before the one referenced as "This question already has an answer here". That one is the duplicate as it came after this one.

– user3071434
Feb 25 at 18:19














45 Answers
45






active

oldest

votes













1 2
next












294














UPDATE



It seems now Chrome ignores the style="display: none;" or style="visibility: hidden; attributes.



You can change it to something like:



<input style="opacity: 0;position: absolute;">
<input type="password" style="opacity: 0;position: absolute;">


In my experience, Chrome only autocompletes the first <input type="password"> and the previous <input>. So I've added:



<input style="display:none">
<input type="password" style="display:none">


To the top of the <form> and the case was resolved.






share|improve this answer





















  • 5





    Here, at version 34, chrome is autocompleting more than one input in the page :(

    – Renato Lochetti
    Apr 22 '14 at 15:28






  • 44





    this not work anymore chrome 40 not work this solution

    – user881703
    Feb 5 '15 at 4:28






  • 1





    Not only is this ugly, but I still can't find any explanation to the Why question??

    – Augustin Riedinger
    Jun 8 '15 at 9:34






  • 4





    It seems Chrome now ignores them if display: none is used, so I moved the fields out of the view with absolute positioning...

    – Christoph Leiter
    Mar 18 '16 at 12:41






  • 1





    @ChristophLeiter, confirm this works. See stackoverflow.com/questions/12374442/…

    – yivo
    May 7 '16 at 13:59



















206














Prevent autocomplete of username (or email) and password:



<input type="email" name="email"><!-- Can be type="text" -->
<input type="password" name="password" autocomplete="new-password">




Prevent autocomplete a field (might not work):



<input type="text" name="field" autocomplete="nope">


Explanation:



autocomplete still works on an <input>despite having autocomplete="off", but you can change off to a random string, like nope.





Others "solutions" for disabling the autocomplete of a field (it's not the right way to do it, but it works):



1.



HTML:



<input type="password" id="some_id" autocomplete="new-password">


JS (onload):



(function() {
var some_id = document.getElementById('some_id');
some_id.type = 'text';
some_id.removeAttribute('autocomplete');
})();


or using jQuery:



$(document).ready(function() {
var some_id = $('#some_id');
some_id.prop('type', 'text');
some_id.removeAttr('autocomplete');
});




2.



HTML:



<form id="form"></form>


JS (onload):



(function() {
var input = document.createElement('INPUT');
input.type = 'text';
document.getElementById('form').appendChild(input);
})();


or using jQuery:



$(document).ready(function() {
$('<input>', {
type: 'text'
}).appendTo($('#form'));
});




To add more than one field using jQuery:






function addField(label) {
var div = $('<div>');
var input = $('<input>', {
type: 'text'
});

if(label) {
var label = $('<label>', {
text: label
});

label.append(input);
div.append(label);
} else {
div.append(input);
}

div.appendTo($('#form'));
}

$(document).ready(function() {
addField();
addField('Field 1: ');
});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form id="form"></form>







Works in:




  • Chrome: 49+


  • Firefox: 44+







share|improve this answer


























  • Theres no code, just how does your answer actually prevent autocomplete if autocomplete="" is supposed to just accept a boolean

    – Tallboy
    Jan 19 '17 at 19:50



















127














It appears that Chrome now ignores autocomplete="off" unless it is on the <form autocomplete="off"> tag.






share|improve this answer
























  • For React use 'autoComplete=off.'

    – zero_cool
    Mar 31 '16 at 19:10











  • For an explanation of why Chrome made this change, see this answer: stackoverflow.com/a/39689037/1766230 -- They prioritize users over developers.

    – Luke
    Sep 25 '16 at 16:18






  • 5





    If you would like to provide the Chrome team with valid reasons for using autocomplete="off" please do so here: bugs.chromium.org/p/chromium/issues/detail?id=587466

    – Chris
    Oct 16 '16 at 13:33








  • 8





    Chrome version 71 ignores all autocomplete attributes on form and input.

    – Digggid
    Dec 30 '18 at 20:46











  • @Digggid Chrome 71 doesn't ignore the attribute, but in some cases it ignores the "off" value. Using a value like "country" still works for me.

    – Burak
    Jan 10 at 9:50



















68














For a reliable workaround, you can add this code to your layout page:



<div style="display: none;">
<input type="text" id="PreventChromeAutocomplete"
name="PreventChromeAutocomplete" autocomplete="address-level4" />
</div>


Chrome respects autocomplete=off only when there is at least one other input element in the form with any other autocomplete value.



This will not work with password fields--those are handled very differently in Chrome. See https://code.google.com/p/chromium/issues/detail?id=468153 for more details.



UPDATE: Bug closed as "Won't Fix" by Chromium Team March 11, 2016. See last comment in my originally filed bug report, for full explanation. TL;DR: use semantic autocomplete attributes such as autocomplete="new-street-address" to avoid Chrome performing autofill.






share|improve this answer





















  • 1





    @Jonathan Cowley-Thom: try these test pages I put up containing my workaround. On hub.securevideo.com/Support/AutocompleteOn, you should see Chrome autocomplete suggestions. Then, try the same entries on hub.securevideo.com/Support/AutocompleteOff. You should not see Chrome autocomplete suggestions. I just tested this on Chrome 45.0.2454.101m and 46.0.2490.71m, and it worked as expected on both.

    – J.T. Taylor
    Oct 14 '15 at 16:21











  • One more update on this matter: I just received a notification from the Chrome team that this has been fixed. So, hopefully this workaround will very soon no longer be needed!

    – J.T. Taylor
    Dec 3 '15 at 23:37











  • See my post above: "This will not work with password fields--those are handled very differently in Chrome. See code.google.com/p/chromium/issues/detail?id=468153 for more details."

    – J.T. Taylor
    Feb 5 '16 at 22:59











  • The solution works fine with Chrome 49, compare using hub.securevideo.com/Support/AutocompleteOff and hub.securevideo.com/Support/AutocompleteOn. Password autofill is a completely different situation than non-password form autocompletes.

    – J.T. Taylor
    Mar 12 '16 at 0:56











  • autocomplete = "chromepleasedontcompletethis" Fixed.

    – Izzy
    Nov 7 '18 at 14:22



















47














Modern Approach



Simply make your input readonly, and on focus, remove it. This is a very simple approach and browsers will not populate readonly inputs. Therefore, this method is accepted and will never be overwritten by future browser updates.



<input type="text" onfocus="this.removeAttribute('readonly');" readonly />


The next part is optional. Style your input accordingly so that it does not look like a readonly input.



input[readonly] {
cursor: text;
background-color: #fff;
}


WORKING EXAMPLE






share|improve this answer





















  • 27





    @Basit - And that's why I called it a modern approach. Less than 1% of users in the world have Javascript turned off. So honestly, it's not worth anyones time accommodating for such a small audience when a large majority of websites rely on Javascript. Been developing websites for a very long time now, and 100% of my sites use Javascript and rely on it heavily. If users have Javascript turned off, that's their own problem and choice, not mine. They'll be unable to visit or use at least 90% of websites online with it turned off... Your downvote is completely irrelevant.

    – Fizzix
    Nov 4 '15 at 0:11






  • 9





    This does not work today in 49. Chrome "developers" is watching stackoverflow solutions and removing them.

    – puchu
    Apr 14 '16 at 13:55











  • @puchu - I'm using Chrome 49 and it's working perfectly fine? Use the following example, enter in a username and password, click 'Submit', save them to your Chrome saved credentials, reload the page, and you will notice that they are not auto filled - jsfiddle.net/w0wxy9ao/18

    – Fizzix
    Apr 18 '16 at 1:00






  • 6





    This answer from September 2015 is basically a copy from the answer in November 2014 down below.

    – dsuess
    Dec 14 '16 at 11:01



















31














Chrome version 34 now ignores the autocomplete=off,
see this.



Lots of discussion on whether this is a good thing or a bad thing? Whats your views?






share|improve this answer





















  • 1





    sorry for the downvote ... this is not a discussion site (try quora instead), and you don't provide an answer. Thanks for the link though.

    – commonpike
    Mar 11 at 19:36



















29














The solution at present is to use type="search". Google doesn't apply autofill to inputs with a type of search.



See: https://twitter.com/Paul_Kinlan/status/596613148985171968



Update 04/04/2016: Looks like this is fixed! See http://codereview.chromium.org/1473733008






share|improve this answer


























  • this is not true as v73

    – Miguel
    Mar 27 at 17:14



















29














Well, a little late to the party, but it seems that there is a bit of misunderstanding about how autocomplete should and shouldn't work. According to the HTML specifications, the user agent (in this case Chrome) can override autocomplete:



https://www.w3.org/TR/html5/forms.html#autofilling-form-controls:-the-autocomplete-attribute




A user agent may allow the user to override an element's autofill field name, e.g. to change it from "off" to "on" to allow values to be remembered and prefilled despite the page author's objections, or to always "off", never remembering values. However, user agents should not allow users to trivially override the autofill field name from "off" to "on" or other values, as there are significant security implications for the user if all values are always remembered, regardless of the site's preferences.




So in the case of Chrome, the developers have essentially said "we will leave this to the user to decide in their preferences whether they want autocomplete to work or not. If you don't want it, don't enable it in your browser".



However, it appears that this is a little over-zealous on their part for my liking, but it is the way it is. The specification also discusses the potential security implications of such a move:




The "off" keyword indicates either that the control's input data is particularly sensitive (for example the activation code for a nuclear weapon); or that it is a value that will never be reused (for example a one-time-key for a bank login) and the user will therefore have to explicitly enter the data each time, instead of being able to rely on the UA to prefill the value for him; or that the document provides its own autocomplete mechanism and does not want the user agent to provide autocompletion values.




So after experiencing the same frustration as everyone else, I found a solution that works for me. It is similar in vein to the autocomplete="false" answers.



A Mozilla article speaks to exactly this problem:



https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion




In some case, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really force the no-completion is to assign a random string to the attribute




So the following code should work:



autocomplete="nope"


And so should each of the following:



autocomplete="false"
autocomplete="foo"
autocomplete="bar"


The issue I see is that the browser agent might be smart enough to learn the autocomplete attribute and apply it next time it sees the form. If it does do this, the only way I can see to still get around the problem would be to dynamically change the autocomplete attribute value when the page is generated.



One point worth mentioning is that many browser will ignore autocomplete settings for login fields (username and password). As the Mozilla article states:




For this reason, many modern browsers do not support autocomplete="off" for login fields.




  • If a site sets autocomplete="off" for a form, and the form includes username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.

  • If a site sets autocomplete="off" for username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.


This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).




Finally a little info on whether the attribute belongs on the form element or the input element. The spec again has the answer:




If the autocomplete attribute is omitted, the default value corresponding to the state of the element's form owner's autocomplete attribute is used instead (either "on" or "off"). If there is no form owner, then the value "on" is used.




So. Putting it on the form should apply to all input fields. Putting it on an individual element should apply to just that element (even if there isn't one on the form). If autocomplete isn't set at all, it defaults to on.



Summary



To disable autocomplete on the whole form:



<form autocomplete="off" ...>


Or if you dynamically need to do it:



<form autocomplete="random-string" ...>


To disable autocomplete on an individual element (regardless of the form setting being present or not)



<input autocomplete="off" ...>


Or if you dynamically need to do it:



<input autocomplete="random-string" ...>


And remember that certain user agents can override even your hardest fought attempts to disable autocomplete.






share|improve this answer

































    23














    Browser does not care about autocomplete=off auto or even fills credentials to wrong text field?



    I fixed it by setting the password field to read-only and activate it, when user clicks into it or uses tab-key to this field.



    fix browser autofill in: readonly and set writeble on focus (at mouse click and tabbing through fields)



     <input type="password" readonly  
    onfocus="$(this).removeAttr('readonly');"/>


    Update:
    Mobile Safari sets cursor in the field, but does not show virtual keyboard. New Fix works like before but handles virtual keyboard:



    <input id="email" readonly type="email" onfocus="if (this.hasAttribute('readonly')) {
    this.removeAttribute('readonly');
    // fix for mobile safari to show virtual keyboard
    this.blur(); this.focus(); }" />


    Live Demo https://jsfiddle.net/danielsuess/n0scguv6/



    // UpdateEnd



    By the way, more information on my observation:



    Sometimes I notice this strange behavior on Chrome and Safari, when there are password fields in the same form. I guess, the browser looks for a password field to insert your saved credentials. Then it autofills username into the nearest textlike-input field , that appears prior the password field in DOM (just guessing due to observation). As the browser is the last instance and you can not control it, sometimes even autocomplete=off would not prevent to fill in credentials into wrong fields, but not user or nickname field.






    share|improve this answer





















    • 2





      rather than using onfocus, I use a setTimeout to clear the readonly, so my users don't see the input is read only and never focus it!

      – Hippyjim
      Mar 3 '15 at 10:10






    • 1





      This works in Chrome v44.0.2403.125 m

      – OutstandingBill
      Aug 11 '15 at 3:26











    • IMO Chrome is being WAY too helpful in autocomplete. I mean, ignoring autocomplete='off', wtf?! Thankfully, your solution worked. Still, WTF! Why wouldn't they trust the developer. If their form isn't auto-completed, it should be on the developer, not the browser to fix it.

      – Funkodebat
      Dec 6 '16 at 18:53



















    20














    You can use autocomplete="new-password"



    <input type="email" name="email">
    <input type="password" name="password" autocomplete="new-password">


    Works in:




    • Chrome: 53, 54, 55

    • Firefox: 48, 49, 50






    share|improve this answer



















    • 2





      This is the most simplest solution and works as of today. None of the above solutions worked for me!

      – learning_to_swim
      Mar 23 '17 at 14:47






    • 1





      As today is 14 May 2018, this is the only working solution so far. Thanks!

      – Adamy
      May 14 '18 at 4:31











    • this no longer works

      – worc
      Mar 25 at 23:05



















    8














    to anyone looking for a solution to this, I finally figure it out.



    Chrome only obey's the autocomplete="off" if the page is a HTML5 page (I was using XHTML).



    I converted my page to HTML5 and the problem went away (facepalm).






    share|improve this answer



















    • 6





      My page is HTML5 and autocomplete="off" on an <input> element wasn't working. I had to turn off autocomplete for the entire form (<form autocomplete="off">) to finally get Chrome to stop autocompleting, since I'd rather not use a JavaScript solution.

      – Gavin
      Aug 15 '13 at 1:05








    • 31





      I've html5 page and it still ignores autocomplete="off" on both fields and form.

      – Ashit Vora
      Jun 25 '14 at 11:48



















    8














    Seen chrome ignore the autocomplete="off", I solve it with a stupid way which is using "fake input" to cheat chrome to fill it up instead of filling the "real" one.



    Example:



    <input type="text" name="username" style="display:none" value="fake input" /> 
    <input type="text" name="username" value="real input"/>


    Chrome will fill up the "fake input", and when submit, server will take the "real input" value.






    share|improve this answer































      8














      Autocomplete="Off" doesn't work anymore.



      Try using just a random string instead of "Off", for example Autocomplete="NoAutocomplete"



      I hope it helps.






      share|improve this answer


























      • You're welcome!

        – marco burrometo
        Mar 13 at 16:22



















      7














      I am posting this answer to bring an updated solution to this problem.
      I am currently using Chrome 49 and no given answer work for this one.
      I am also looking for a solution working with other browsers and previous versions.



      Put this code on the beginning of your form



      <div style="display: none;">
      <input type="text" autocomplete="new-password">
      <input type="password" autocomplete="new-password">
      </div>


      Then, for your real password field, use



      <input type="password" name="password" autocomplete="new-password">


      Comment this answer if this is no longer working or if you get an issue with another browser or version.



      Approved on:




      • Chrome : 49

      • Firefox : 44, 45

      • Edge : 25

      • Internet Explorer : 11






      share|improve this answer





















      • 1





        Unfortunately, Chrome version 49.0.2623.87 and it does not work for TextBox, I still see autocomplete poping up.

        – eYe
        Mar 31 '16 at 14:39





















      6














      Up until just this last week, the two solutions below appeared to work for Chrome, IE and Firefox. But with the release of Chrome version 48 (and still in 49), they no longer work:




      1. The following at the top of the form:


      <input style="display:none" type="text" name="fakeUsername"/>
      <input style="display:none" type="password" name="fakePassword"/>




      1. The following in the password input element:



        autocomplete="off"




      So to quickly fix this, at first I tried to use a major hack of initially setting the password input element to disabled and then used a setTimeout in the document ready function to enable it again.



      setTimeout(function(){$('#PasswordData').prop('disabled', false);}, 50);


      But this seemed so crazy and I did some more searching and found @tibalts answer in Disabling Chrome Autofill. His answer is to use autocomplete="new-password" in the passwords input and this appears to work on all browsers (I have kept my fix number 1 above at this stage).



      Here is the link in the Google Chrome developer discussion:
      https://code.google.com/p/chromium/issues/detail?id=370363#c7






      share|improve this answer


























      • autocomplete="new-password" worked on 49.0.2623.87

        – Jorge Sampayo
        Mar 10 '16 at 17:40











      • @JorgeSampayo Only works on password inputs but not on text inputs.

        – eYe
        Mar 31 '16 at 15:52











      • autocomplete="new-password" does not seem to work in FF 50 or IE 11

        – Andreas
        Dec 9 '16 at 12:27



















      5














      Instead of autocomplete="off" use autocomplete="false" ;)



      from: https://stackoverflow.com/a/29582380/75799






      share|improve this answer





















      • 1





        Actually not working in Chrome 65

        – Guilherme IA
        Mar 15 '18 at 21:55



















      5














      autocomplete=off is largely ignored in modern browsers - primarily due to password managers etc.



      You can try adding this autocomplete="new-password" it's not fully supported by all browsers, but it works on some






      share|improve this answer































        4














        As of Chrome 42, none of the solutions/hacks in this thread (as of 2015-05-21T12:50:23+00:00) work for disabling autocomplete for an individual field or the entire form.



        EDIT: I've found that you actually only need to insert one dummy email field into your form (you can hide it with display: none) before the other fields to prevent autocompleting. I presume that chrome stores some sort of form signature with each autocompleted field and including another email field corrupts this signature and prevents autocompleting.



        <form action="/login" method="post">
        <input type="email" name="fake_email" style="display:none" aria-hidden="true">
        <input type="email" name="email">
        <input type="password" name="password">
        <input type="submit">
        </form>


        The good news is that since the "form signature" is corrupted by this, none of the fields are autocompleted, so no JS is needed to clear the fake fields before submission.



        Old Answer:



        The only thing I've found to be still viable is to insert two dummy fields of type email and password before the real fields. You can set them to display: none to hide them away (it isn't smart enough to ignore those fields):



        <form action="/login" method="post">
        <input type="email" name="fake_email" style="display:none" aria-hidden="true">
        <input type="password" name="fake_password" style="display:none" aria-hidden="true">
        <input type="email" name="email">
        <input type="password" name="password">
        <input type="submit">
        </form>


        Unfortunately, the fields must be within your form (otherwise both sets of inputs are autofilled). So, for the fake fields to be truly ignored you'll need some JS to run on form submit to clear them:



        form.addEventListener('submit', function() {
        form.elements['fake_email'].value = '';
        form.elements['fake_password'].value = '';
        });




        Notice from above that clearing the value with Javascript works to override the autocomplete. So if loosing the proper behavior with JS disabled is acceptable, you can simplify all of this with a JS autocomplete "polyfill" for Chrome:



        (function(document) {

        function polyfillAutocomplete(nodes) {

        for(var i = 0, length = nodes.length; i < length; i++) {

        if(nodes[i].getAttribute('autocomplete') === 'off') {

        nodes[i].value = '';
        }
        }
        }

        setTimeout(function() {

        polyfillAutocomplete(document.getElementsByTagName('input'));
        polyfillAutocomplete(document.getElementsByTagName('textarea'));

        }, 1);

        })(window.document);





        share|improve this answer
























        • All of these solutions require a form tag; but what if your form tag is part of your masterpage?

          – Jonathon Cowley-Thom
          Oct 12 '15 at 10:09











        • I don't know what you mean by masterpage, but regardless of the scope of the form, you should be able to disable autocomplete by including a dummy email before your real email field.

          – Bailey Parker
          Oct 18 '15 at 21:38



















        3














        After the chrome v. 34, setting autocomplete="off" at <form> tag doesn`t work



        I made the changes to avoid this annoying behavior:




        1. Remove the name and the id of the password input

        2. Put a class in the input (ex.: passwordInput )


        (So far, Chrome wont put the saved password on the input, but the form is now broken)



        Finally, to make the form work, put this code to run when the user click the submit button, or whenever you want to trigger the form submittion:



        var sI = $(".passwordInput")[0];
        $(sI).attr("id", "password");
        $(sI).attr("name", "password");


        In my case, I used to hav id="password" name="password" in the password input, so I put them back before trigger the submition.






        share|improve this answer
























        • Yes, and this google's decision is really strange - theregister.co.uk/2014/04/09/…

          – cryss
          May 5 '14 at 9:33











        • This works, but it's no fun trying to do this when you've got a self-registration form with 20-odd fields on it, all of which need to be autocomplete="off".

          – Jonathon Cowley-Thom
          Oct 12 '15 at 10:14



















        3














        After having tried all solutions, Here is what seems to be working for chrome version:45, with form having password field :



         jQuery('document').ready(function(){
        //For disabling Chrome Autocomplete
        jQuery( ":text" ).attr('autocomplete','pre'+Math.random(0,100000000));
        });





        share|improve this answer



















        • 1





          what does 'pre'+Math.random(0,100000000) do? Can you please give more detail on your answer.

          – Serge Eremeev
          Jun 20 '16 at 9:58



















        3














        Change input type attribute to type="search".



        Google doesn't apply auto-fill to inputs with a type of search.






        share|improve this answer
























        • I am not down voting this solution but need to mention that I have just tried using search as type and it still gets auto-completed...

          – eYe
          Mar 31 '16 at 14:53











        • @eYe Hmm, could be they patched this one up too. Thanks for letting me know.

          – Matas Vaitkevicius
          Mar 31 '16 at 14:59













        • I'll downvote: tested on chrome 60: this doesn't prevent autocomplete..

          – boly38
          Sep 21 '17 at 10:10











        • It works on Chrome V64.0.3282.167

          – Jaggana
          Feb 27 '18 at 12:39



















        3














        I just updated to Chrome 49 and Diogo Cid's solution doesn't work anymore.



        I made a different workaround hiding and removing the fields at run-time after the page is loaded.



        Chrome now ignores the original workaround applying the credentials to the first displayed type="password" field and its previous type="text" field, so I have hidden both fields using CSS visibility: hidden;



        <!-- HTML -->
        <form>
        <!-- Fake fields -->
        <input class="chromeHack-autocomplete">
        <input type="password" class="chromeHack-autocomplete">

        <input type="text" placeholder="e-mail" autocomplete="off" />
        <input type="password" placeholder="Password" autocomplete="off" />
        </form>

        <!-- CSS -->
        .chromeHack-autocomplete {
        height: 0px !important;
        width: 0px !important;
        opacity: 0 !important;
        padding: 0 !important; margin: 0 !important;
        }

        <!--JavaScript (jQuery) -->
        jQuery(window).load(function() {
        $(".chromeHack-autocomplete").delay(100).hide(0, function() {
        $(this).remove();
        });
        });


        I know that it may seem not very elegant but it works.






        share|improve this answer

































          3














          In Chrome 48+ use this solution:





          1. Put fake fields before real fields:



            <form autocomplete="off">
            <input name="fake_email" class="visually-hidden" type="text">
            <input name="fake_password" class="visually-hidden" type="password">

            <input autocomplete="off" name="email" type="text">
            <input autocomplete="off" name="password" type="password">
            </form>



          2. Hide fake fields:



            .visually-hidden {
            margin: -1px;
            padding: 0;
            width: 1px;
            height: 1px;
            overflow: hidden;
            clip: rect(0 0 0 0);
            clip: rect(0, 0, 0, 0);
            position: absolute;
            }


          3. You did it!



          Also this will work for older versions.






          share|improve this answer


























          • This works for me with Chrome 52...

            – Daniel Bleisteiner
            Aug 1 '16 at 11:38











          • Anyone confirm if this is working for version 60? Tried implementing and doesn't appear to work except for incognito :(

            – Mike Purcell
            Aug 28 '17 at 18:57











          • @MikePurcell It works for me. I have OS X 10.12.4 and Chrome 60.0.3112.101. See screenshots what you actually should have: dropbox.com/s/11btbxl469hagbt/… and dropbox.com/s/73nom28iewd8z8m/…

            – yivo
            Aug 29 '17 at 9:32













          • @yivo Looks like the only diff between urs and og answer is the !important tags, so I added them, still not working. dropbox.com/s/24yaz6ut7ygkoql/…

            – Mike Purcell
            Aug 29 '17 at 13:45











          • @MikePurcell You don't have autocomplete="off" on the form tag. Also try to put fake inputs immediately after form tag.

            – yivo
            Aug 30 '17 at 8:17



















          3














          TL;DR: Tell Chrome that this is a new password input and it won't provide old ones as autocomplete suggestions:



          <input type="password" name="password" autocomplete="new-password">




          autocomplete="off" doesn't work due to a design decision - lots of research shows that users have much longer and harder to hack passwords if they can store them in a browser or password manager.



          The specification for autocomplete has changed, and now supports various values to make login forms easy to auto complete:



          <!-- Auto fills with the username for the site, even though it's email format -->
          <input type="email" name="email" autocomplete="username">

          <!-- current-password will populate for the matched username input -->
          <input type="password" autocomplete="current-password" />


          If you don't provide these Chrome still tries to guess, and when it does it ignores autocomplete="off".



          The solution is that autocomplete values also exist for password reset forms:



          <label>Enter your old password:
          <input type="password" autocomplete="current-password" name="pass-old" />
          </label>
          <label>Enter your new password:
          <input type="password" autocomplete="new-password" name="pass-new" />
          </label>
          <label>Please repeat it to be sure:
          <input type="password" autocomplete="new-password" name="pass-repeat" />
          </label>


          You can use this autocomplete="new-password" flag to tell Chrome not to guess the password, even if it has one stored for this site.



          Chrome can also manage passwords for sites directly using the credentials API, which is a standard and will probably have universal support eventually.






          share|improve this answer





















          • 4





            Not a really compelling reason. The fact that the user wants something doesn't mean it is a smart idea. That's almost as bad as saying you will allow single character passwords in your application because the user finds it more convenient. At times, security trumps convenience...

            – Daniel Kotin
            Jul 22 '14 at 13:28











          • @Infinitesimus - good point, but with password complexity you're protecting the user from someone cracking the password, i.e. something out of their control. Here the hacking risk is that they could leave their machine unlocked and someone use autocompete to log in as them or something similar. That's something very much in control of the user, and whether they're trusted to autofill forms should be up to the administrator of the machine, not each individual application. Personally I hate sites that won't cache my form inputs, but if I was administrator I'd turn autofill off for my users.

            – Keith
            Jul 22 '14 at 15:27











          • I have a field called "ContactNoAlt" that Chrome insists on filling with an EmailAddress. Autocomplete on/off is preferred but a work-around is needed on a practical level because Chrome is falible. More pointedly autocomplete="off" is a standard - so what makes the developers of Chrome so good that they just feel they can ignore standards - perhaps one day Chrome will decide some other piece of HTML is inconvenient .... (this is starting to feel like IE5/6 de-ja-vu)

            – dunxz
            Aug 3 '14 at 21:38













          • I'm a chrome user, and I don't want this behaviour. It didn't even ask me before it autofilled the password box that was popping up to make sure only I could access the web application concerned. Saving some passwords shouldn't mean autocompleting all passwords.

            – Hippyjim
            Mar 3 '15 at 10:15






          • 1





            This answer (and Googles behaviour) ignore the fact that one of the major reasons you might want to do this is to implement your own (e.g, list from database) autocompletion behaviours.

            – squarelogic.hayden
            Aug 13 '15 at 14:30



















          3














          I've solved the endless fight with Google Chrome with the use of random characters.



          <input name="name" type="text" autocomplete="rutjfkde">


          Hope that it will help to other people.






          share|improve this answer































            3














            autocomplete="off" works now, so you can just do the following:



            <input id="firstName2" name="firstName2" autocomplete="off">


            Tested in the current Chrome 70 as well as in all versions starting from Chrome 62.



            Demo.



            UPDATE: Since people tend to downvote this (see, for instance, a comment from @AntonKuznetsov down below) before reading the demonstration in the JSFiddle or actually looking into the JSFiddle's HTML, I have to express it clearly:




            • the top input has the auto complete working


            • the bottom input has the auto complete disabled by adding autocomplete="off"






            share|improve this answer


























            • I can confirm this. autocomplete="new-password" appears to no longer work.

              – ShibbyUK
              Sep 3 '18 at 9:56






            • 1





              Tested on Chrome 69, it's working!

              – Matheus Cuba
              Sep 6 '18 at 17:20











            • Does not work — Chrome Version 70.0.3538.102 user-images.githubusercontent.com/1788245/…

              – Anton Kuznetsov
              Nov 15 '18 at 11:12








            • 1





              @AntonKuznetsov Please take a closer look at the JSFiddle's HTML: the bottom input has autocomplete="off", whereas the upper one doesn't. So, the auto completer is meant to be disabled for the bottom input only, but on your screen shot you're testing auto complete on the upper one. Thus, this still is the proper way of disabling the auto complete for Chrome 70. I'd appreciate if you check it out more thoroughly and upvote this one instead of downvoting.

              – Alexander Abakumov
              Nov 15 '18 at 15:53





















            2














            i found this solution to be the most appropriate:



            function clearChromeAutocomplete()
            {
            // not possible, let's try:
            if (navigator.userAgent.toLowerCase().indexOf('chrome') >= 0)
            {
            document.getElementById('adminForm').setAttribute('autocomplete', 'off');
            setTimeout(function () {
            document.getElementById('adminForm').setAttribute('autocomplete', 'on');
            }, 1500);
            }
            }


            It must be loaded after dom ready, or after the form renders.






            share|improve this answer































              2














              Whilst I agree autocomplete should be a user choice, there are times when Chrome is over-zealous with it (other browsers may be too). For instance, a password field with a different name is still auto-filled with a saved password and the previous field populated with the username. This particularly sucks when the form is a user management form for a web app and you don't want autofill to populate it with your own credentials.



              Chrome completely ignores autocomplete="off" now. Whilst the JS hacks may well work, I found a simple way which works at the time of writing:



              Set the value of the password field to the control character 8 ("x08" in PHP or &#8; in HTML). This stops Chrome auto-filling the field because it has a value, but no actual value is entered because this is the backspace character.



              Yes this is still a hack, but it works for me. YMMV.






              share|improve this answer
























              • Care to explain the down vote? The accepted answer doesn't even work and is also a kludge, which I accept mine is too. At least mine works and does actually answer the question.

                – spikyjt
                Nov 24 '14 at 14:40











              • Doesn't seem to work in Chrome 40

                – hood
                Jan 28 '15 at 5:14











              • Prefilled values seem to be getting overwritten now :(

                – Hippyjim
                Mar 3 '15 at 10:12











              • I think they've picked up this hack and ignored control characters in the value, so it now evaluates to empty. See the answer by @ice-cream stackoverflow.com/a/16130452/752696 for the correct, up-to-date solution.

                – spikyjt
                Mar 5 '15 at 11:44













              • Same use case here: Working with user management and having own credentials autofilled. However since it's my own code and I reuse the form for creating new and editing existing users simply overriding input values via JS removed the auto-complete.

                – nuala
                Apr 5 '15 at 12:21



















              2














              I solved in another way. You can try this.



              <input id="passfld" type="text" autocomplete="off" />
              <script type="text/javascript">
              // Using jQuery
              $(function(){
              setTimeout(function(){
              $("input#passfld").attr("type","password");
              },10);
              });


              // or in pure javascript
              window.onload=function(){
              setTimeout(function(){
              document.getElementById('passfld').type = 'password';
              },10);
              }
              </script>





              share|improve this answer































                2














                I had a similar issue where the input field took either a name or an email. I set autocomplete="off" but Chrome still forced suggestions. Turns out it was because the placeholder text had the words "name" and "email" in it.



                For example



                <input type="text" placeholder="name or email" autocomplete="off" />


                I got around it by putting a zero width space into the words in the placeholder. No more Chrome autocomplete.



                <input type="text" placeholder="nam​e or emai​l" autocomplete="off" />





                share|improve this answer





























                  1 2
                  next










                  45 Answers
                  45






                  active

                  oldest

                  votes








                  45 Answers
                  45






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes








                  1 2
                  next










                  294














                  UPDATE



                  It seems now Chrome ignores the style="display: none;" or style="visibility: hidden; attributes.



                  You can change it to something like:



                  <input style="opacity: 0;position: absolute;">
                  <input type="password" style="opacity: 0;position: absolute;">


                  In my experience, Chrome only autocompletes the first <input type="password"> and the previous <input>. So I've added:



                  <input style="display:none">
                  <input type="password" style="display:none">


                  To the top of the <form> and the case was resolved.






                  share|improve this answer





















                  • 5





                    Here, at version 34, chrome is autocompleting more than one input in the page :(

                    – Renato Lochetti
                    Apr 22 '14 at 15:28






                  • 44





                    this not work anymore chrome 40 not work this solution

                    – user881703
                    Feb 5 '15 at 4:28






                  • 1





                    Not only is this ugly, but I still can't find any explanation to the Why question??

                    – Augustin Riedinger
                    Jun 8 '15 at 9:34






                  • 4





                    It seems Chrome now ignores them if display: none is used, so I moved the fields out of the view with absolute positioning...

                    – Christoph Leiter
                    Mar 18 '16 at 12:41






                  • 1





                    @ChristophLeiter, confirm this works. See stackoverflow.com/questions/12374442/…

                    – yivo
                    May 7 '16 at 13:59
















                  294














                  UPDATE



                  It seems now Chrome ignores the style="display: none;" or style="visibility: hidden; attributes.



                  You can change it to something like:



                  <input style="opacity: 0;position: absolute;">
                  <input type="password" style="opacity: 0;position: absolute;">


                  In my experience, Chrome only autocompletes the first <input type="password"> and the previous <input>. So I've added:



                  <input style="display:none">
                  <input type="password" style="display:none">


                  To the top of the <form> and the case was resolved.






                  share|improve this answer





















                  • 5





                    Here, at version 34, chrome is autocompleting more than one input in the page :(

                    – Renato Lochetti
                    Apr 22 '14 at 15:28






                  • 44





                    this not work anymore chrome 40 not work this solution

                    – user881703
                    Feb 5 '15 at 4:28






                  • 1





                    Not only is this ugly, but I still can't find any explanation to the Why question??

                    – Augustin Riedinger
                    Jun 8 '15 at 9:34






                  • 4





                    It seems Chrome now ignores them if display: none is used, so I moved the fields out of the view with absolute positioning...

                    – Christoph Leiter
                    Mar 18 '16 at 12:41






                  • 1





                    @ChristophLeiter, confirm this works. See stackoverflow.com/questions/12374442/…

                    – yivo
                    May 7 '16 at 13:59














                  294












                  294








                  294







                  UPDATE



                  It seems now Chrome ignores the style="display: none;" or style="visibility: hidden; attributes.



                  You can change it to something like:



                  <input style="opacity: 0;position: absolute;">
                  <input type="password" style="opacity: 0;position: absolute;">


                  In my experience, Chrome only autocompletes the first <input type="password"> and the previous <input>. So I've added:



                  <input style="display:none">
                  <input type="password" style="display:none">


                  To the top of the <form> and the case was resolved.






                  share|improve this answer















                  UPDATE



                  It seems now Chrome ignores the style="display: none;" or style="visibility: hidden; attributes.



                  You can change it to something like:



                  <input style="opacity: 0;position: absolute;">
                  <input type="password" style="opacity: 0;position: absolute;">


                  In my experience, Chrome only autocompletes the first <input type="password"> and the previous <input>. So I've added:



                  <input style="display:none">
                  <input type="password" style="display:none">


                  To the top of the <form> and the case was resolved.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 12 '18 at 13:01

























                  answered Mar 27 '14 at 16:54









                  Diogo CidDiogo Cid

                  3,27611320




                  3,27611320








                  • 5





                    Here, at version 34, chrome is autocompleting more than one input in the page :(

                    – Renato Lochetti
                    Apr 22 '14 at 15:28






                  • 44





                    this not work anymore chrome 40 not work this solution

                    – user881703
                    Feb 5 '15 at 4:28






                  • 1





                    Not only is this ugly, but I still can't find any explanation to the Why question??

                    – Augustin Riedinger
                    Jun 8 '15 at 9:34






                  • 4





                    It seems Chrome now ignores them if display: none is used, so I moved the fields out of the view with absolute positioning...

                    – Christoph Leiter
                    Mar 18 '16 at 12:41






                  • 1





                    @ChristophLeiter, confirm this works. See stackoverflow.com/questions/12374442/…

                    – yivo
                    May 7 '16 at 13:59














                  • 5





                    Here, at version 34, chrome is autocompleting more than one input in the page :(

                    – Renato Lochetti
                    Apr 22 '14 at 15:28






                  • 44





                    this not work anymore chrome 40 not work this solution

                    – user881703
                    Feb 5 '15 at 4:28






                  • 1





                    Not only is this ugly, but I still can't find any explanation to the Why question??

                    – Augustin Riedinger
                    Jun 8 '15 at 9:34






                  • 4





                    It seems Chrome now ignores them if display: none is used, so I moved the fields out of the view with absolute positioning...

                    – Christoph Leiter
                    Mar 18 '16 at 12:41






                  • 1





                    @ChristophLeiter, confirm this works. See stackoverflow.com/questions/12374442/…

                    – yivo
                    May 7 '16 at 13:59








                  5




                  5





                  Here, at version 34, chrome is autocompleting more than one input in the page :(

                  – Renato Lochetti
                  Apr 22 '14 at 15:28





                  Here, at version 34, chrome is autocompleting more than one input in the page :(

                  – Renato Lochetti
                  Apr 22 '14 at 15:28




                  44




                  44





                  this not work anymore chrome 40 not work this solution

                  – user881703
                  Feb 5 '15 at 4:28





                  this not work anymore chrome 40 not work this solution

                  – user881703
                  Feb 5 '15 at 4:28




                  1




                  1





                  Not only is this ugly, but I still can't find any explanation to the Why question??

                  – Augustin Riedinger
                  Jun 8 '15 at 9:34





                  Not only is this ugly, but I still can't find any explanation to the Why question??

                  – Augustin Riedinger
                  Jun 8 '15 at 9:34




                  4




                  4





                  It seems Chrome now ignores them if display: none is used, so I moved the fields out of the view with absolute positioning...

                  – Christoph Leiter
                  Mar 18 '16 at 12:41





                  It seems Chrome now ignores them if display: none is used, so I moved the fields out of the view with absolute positioning...

                  – Christoph Leiter
                  Mar 18 '16 at 12:41




                  1




                  1





                  @ChristophLeiter, confirm this works. See stackoverflow.com/questions/12374442/…

                  – yivo
                  May 7 '16 at 13:59





                  @ChristophLeiter, confirm this works. See stackoverflow.com/questions/12374442/…

                  – yivo
                  May 7 '16 at 13:59













                  206














                  Prevent autocomplete of username (or email) and password:



                  <input type="email" name="email"><!-- Can be type="text" -->
                  <input type="password" name="password" autocomplete="new-password">




                  Prevent autocomplete a field (might not work):



                  <input type="text" name="field" autocomplete="nope">


                  Explanation:



                  autocomplete still works on an <input>despite having autocomplete="off", but you can change off to a random string, like nope.





                  Others "solutions" for disabling the autocomplete of a field (it's not the right way to do it, but it works):



                  1.



                  HTML:



                  <input type="password" id="some_id" autocomplete="new-password">


                  JS (onload):



                  (function() {
                  var some_id = document.getElementById('some_id');
                  some_id.type = 'text';
                  some_id.removeAttribute('autocomplete');
                  })();


                  or using jQuery:



                  $(document).ready(function() {
                  var some_id = $('#some_id');
                  some_id.prop('type', 'text');
                  some_id.removeAttr('autocomplete');
                  });




                  2.



                  HTML:



                  <form id="form"></form>


                  JS (onload):



                  (function() {
                  var input = document.createElement('INPUT');
                  input.type = 'text';
                  document.getElementById('form').appendChild(input);
                  })();


                  or using jQuery:



                  $(document).ready(function() {
                  $('<input>', {
                  type: 'text'
                  }).appendTo($('#form'));
                  });




                  To add more than one field using jQuery:






                  function addField(label) {
                  var div = $('<div>');
                  var input = $('<input>', {
                  type: 'text'
                  });

                  if(label) {
                  var label = $('<label>', {
                  text: label
                  });

                  label.append(input);
                  div.append(label);
                  } else {
                  div.append(input);
                  }

                  div.appendTo($('#form'));
                  }

                  $(document).ready(function() {
                  addField();
                  addField('Field 1: ');
                  });

                  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
                  <form id="form"></form>







                  Works in:




                  • Chrome: 49+


                  • Firefox: 44+







                  share|improve this answer


























                  • Theres no code, just how does your answer actually prevent autocomplete if autocomplete="" is supposed to just accept a boolean

                    – Tallboy
                    Jan 19 '17 at 19:50
















                  206














                  Prevent autocomplete of username (or email) and password:



                  <input type="email" name="email"><!-- Can be type="text" -->
                  <input type="password" name="password" autocomplete="new-password">




                  Prevent autocomplete a field (might not work):



                  <input type="text" name="field" autocomplete="nope">


                  Explanation:



                  autocomplete still works on an <input>despite having autocomplete="off", but you can change off to a random string, like nope.





                  Others "solutions" for disabling the autocomplete of a field (it's not the right way to do it, but it works):



                  1.



                  HTML:



                  <input type="password" id="some_id" autocomplete="new-password">


                  JS (onload):



                  (function() {
                  var some_id = document.getElementById('some_id');
                  some_id.type = 'text';
                  some_id.removeAttribute('autocomplete');
                  })();


                  or using jQuery:



                  $(document).ready(function() {
                  var some_id = $('#some_id');
                  some_id.prop('type', 'text');
                  some_id.removeAttr('autocomplete');
                  });




                  2.



                  HTML:



                  <form id="form"></form>


                  JS (onload):



                  (function() {
                  var input = document.createElement('INPUT');
                  input.type = 'text';
                  document.getElementById('form').appendChild(input);
                  })();


                  or using jQuery:



                  $(document).ready(function() {
                  $('<input>', {
                  type: 'text'
                  }).appendTo($('#form'));
                  });




                  To add more than one field using jQuery:






                  function addField(label) {
                  var div = $('<div>');
                  var input = $('<input>', {
                  type: 'text'
                  });

                  if(label) {
                  var label = $('<label>', {
                  text: label
                  });

                  label.append(input);
                  div.append(label);
                  } else {
                  div.append(input);
                  }

                  div.appendTo($('#form'));
                  }

                  $(document).ready(function() {
                  addField();
                  addField('Field 1: ');
                  });

                  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
                  <form id="form"></form>







                  Works in:




                  • Chrome: 49+


                  • Firefox: 44+







                  share|improve this answer


























                  • Theres no code, just how does your answer actually prevent autocomplete if autocomplete="" is supposed to just accept a boolean

                    – Tallboy
                    Jan 19 '17 at 19:50














                  206












                  206








                  206







                  Prevent autocomplete of username (or email) and password:



                  <input type="email" name="email"><!-- Can be type="text" -->
                  <input type="password" name="password" autocomplete="new-password">




                  Prevent autocomplete a field (might not work):



                  <input type="text" name="field" autocomplete="nope">


                  Explanation:



                  autocomplete still works on an <input>despite having autocomplete="off", but you can change off to a random string, like nope.





                  Others "solutions" for disabling the autocomplete of a field (it's not the right way to do it, but it works):



                  1.



                  HTML:



                  <input type="password" id="some_id" autocomplete="new-password">


                  JS (onload):



                  (function() {
                  var some_id = document.getElementById('some_id');
                  some_id.type = 'text';
                  some_id.removeAttribute('autocomplete');
                  })();


                  or using jQuery:



                  $(document).ready(function() {
                  var some_id = $('#some_id');
                  some_id.prop('type', 'text');
                  some_id.removeAttr('autocomplete');
                  });




                  2.



                  HTML:



                  <form id="form"></form>


                  JS (onload):



                  (function() {
                  var input = document.createElement('INPUT');
                  input.type = 'text';
                  document.getElementById('form').appendChild(input);
                  })();


                  or using jQuery:



                  $(document).ready(function() {
                  $('<input>', {
                  type: 'text'
                  }).appendTo($('#form'));
                  });




                  To add more than one field using jQuery:






                  function addField(label) {
                  var div = $('<div>');
                  var input = $('<input>', {
                  type: 'text'
                  });

                  if(label) {
                  var label = $('<label>', {
                  text: label
                  });

                  label.append(input);
                  div.append(label);
                  } else {
                  div.append(input);
                  }

                  div.appendTo($('#form'));
                  }

                  $(document).ready(function() {
                  addField();
                  addField('Field 1: ');
                  });

                  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
                  <form id="form"></form>







                  Works in:




                  • Chrome: 49+


                  • Firefox: 44+







                  share|improve this answer















                  Prevent autocomplete of username (or email) and password:



                  <input type="email" name="email"><!-- Can be type="text" -->
                  <input type="password" name="password" autocomplete="new-password">




                  Prevent autocomplete a field (might not work):



                  <input type="text" name="field" autocomplete="nope">


                  Explanation:



                  autocomplete still works on an <input>despite having autocomplete="off", but you can change off to a random string, like nope.





                  Others "solutions" for disabling the autocomplete of a field (it's not the right way to do it, but it works):



                  1.



                  HTML:



                  <input type="password" id="some_id" autocomplete="new-password">


                  JS (onload):



                  (function() {
                  var some_id = document.getElementById('some_id');
                  some_id.type = 'text';
                  some_id.removeAttribute('autocomplete');
                  })();


                  or using jQuery:



                  $(document).ready(function() {
                  var some_id = $('#some_id');
                  some_id.prop('type', 'text');
                  some_id.removeAttr('autocomplete');
                  });




                  2.



                  HTML:



                  <form id="form"></form>


                  JS (onload):



                  (function() {
                  var input = document.createElement('INPUT');
                  input.type = 'text';
                  document.getElementById('form').appendChild(input);
                  })();


                  or using jQuery:



                  $(document).ready(function() {
                  $('<input>', {
                  type: 'text'
                  }).appendTo($('#form'));
                  });




                  To add more than one field using jQuery:






                  function addField(label) {
                  var div = $('<div>');
                  var input = $('<input>', {
                  type: 'text'
                  });

                  if(label) {
                  var label = $('<label>', {
                  text: label
                  });

                  label.append(input);
                  div.append(label);
                  } else {
                  div.append(input);
                  }

                  div.appendTo($('#form'));
                  }

                  $(document).ready(function() {
                  addField();
                  addField('Field 1: ');
                  });

                  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
                  <form id="form"></form>







                  Works in:




                  • Chrome: 49+


                  • Firefox: 44+







                  function addField(label) {
                  var div = $('<div>');
                  var input = $('<input>', {
                  type: 'text'
                  });

                  if(label) {
                  var label = $('<label>', {
                  text: label
                  });

                  label.append(input);
                  div.append(label);
                  } else {
                  div.append(input);
                  }

                  div.appendTo($('#form'));
                  }

                  $(document).ready(function() {
                  addField();
                  addField('Field 1: ');
                  });

                  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
                  <form id="form"></form>





                  function addField(label) {
                  var div = $('<div>');
                  var input = $('<input>', {
                  type: 'text'
                  });

                  if(label) {
                  var label = $('<label>', {
                  text: label
                  });

                  label.append(input);
                  div.append(label);
                  } else {
                  div.append(input);
                  }

                  div.appendTo($('#form'));
                  }

                  $(document).ready(function() {
                  addField();
                  addField('Field 1: ');
                  });

                  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
                  <form id="form"></form>






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Aug 29 '18 at 14:24









                  Alexander Abakumov

                  4,94354773




                  4,94354773










                  answered Aug 15 '16 at 19:18









                  CavaCava

                  2,40511123




                  2,40511123













                  • Theres no code, just how does your answer actually prevent autocomplete if autocomplete="" is supposed to just accept a boolean

                    – Tallboy
                    Jan 19 '17 at 19:50



















                  • Theres no code, just how does your answer actually prevent autocomplete if autocomplete="" is supposed to just accept a boolean

                    – Tallboy
                    Jan 19 '17 at 19:50

















                  Theres no code, just how does your answer actually prevent autocomplete if autocomplete="" is supposed to just accept a boolean

                  – Tallboy
                  Jan 19 '17 at 19:50





                  Theres no code, just how does your answer actually prevent autocomplete if autocomplete="" is supposed to just accept a boolean

                  – Tallboy
                  Jan 19 '17 at 19:50











                  127














                  It appears that Chrome now ignores autocomplete="off" unless it is on the <form autocomplete="off"> tag.






                  share|improve this answer
























                  • For React use 'autoComplete=off.'

                    – zero_cool
                    Mar 31 '16 at 19:10











                  • For an explanation of why Chrome made this change, see this answer: stackoverflow.com/a/39689037/1766230 -- They prioritize users over developers.

                    – Luke
                    Sep 25 '16 at 16:18






                  • 5





                    If you would like to provide the Chrome team with valid reasons for using autocomplete="off" please do so here: bugs.chromium.org/p/chromium/issues/detail?id=587466

                    – Chris
                    Oct 16 '16 at 13:33








                  • 8





                    Chrome version 71 ignores all autocomplete attributes on form and input.

                    – Digggid
                    Dec 30 '18 at 20:46











                  • @Digggid Chrome 71 doesn't ignore the attribute, but in some cases it ignores the "off" value. Using a value like "country" still works for me.

                    – Burak
                    Jan 10 at 9:50
















                  127














                  It appears that Chrome now ignores autocomplete="off" unless it is on the <form autocomplete="off"> tag.






                  share|improve this answer
























                  • For React use 'autoComplete=off.'

                    – zero_cool
                    Mar 31 '16 at 19:10











                  • For an explanation of why Chrome made this change, see this answer: stackoverflow.com/a/39689037/1766230 -- They prioritize users over developers.

                    – Luke
                    Sep 25 '16 at 16:18






                  • 5





                    If you would like to provide the Chrome team with valid reasons for using autocomplete="off" please do so here: bugs.chromium.org/p/chromium/issues/detail?id=587466

                    – Chris
                    Oct 16 '16 at 13:33








                  • 8





                    Chrome version 71 ignores all autocomplete attributes on form and input.

                    – Digggid
                    Dec 30 '18 at 20:46











                  • @Digggid Chrome 71 doesn't ignore the attribute, but in some cases it ignores the "off" value. Using a value like "country" still works for me.

                    – Burak
                    Jan 10 at 9:50














                  127












                  127








                  127







                  It appears that Chrome now ignores autocomplete="off" unless it is on the <form autocomplete="off"> tag.






                  share|improve this answer













                  It appears that Chrome now ignores autocomplete="off" unless it is on the <form autocomplete="off"> tag.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 21 '13 at 11:03









                  ice creamice cream

                  1,78021213




                  1,78021213













                  • For React use 'autoComplete=off.'

                    – zero_cool
                    Mar 31 '16 at 19:10











                  • For an explanation of why Chrome made this change, see this answer: stackoverflow.com/a/39689037/1766230 -- They prioritize users over developers.

                    – Luke
                    Sep 25 '16 at 16:18






                  • 5





                    If you would like to provide the Chrome team with valid reasons for using autocomplete="off" please do so here: bugs.chromium.org/p/chromium/issues/detail?id=587466

                    – Chris
                    Oct 16 '16 at 13:33








                  • 8





                    Chrome version 71 ignores all autocomplete attributes on form and input.

                    – Digggid
                    Dec 30 '18 at 20:46











                  • @Digggid Chrome 71 doesn't ignore the attribute, but in some cases it ignores the "off" value. Using a value like "country" still works for me.

                    – Burak
                    Jan 10 at 9:50



















                  • For React use 'autoComplete=off.'

                    – zero_cool
                    Mar 31 '16 at 19:10











                  • For an explanation of why Chrome made this change, see this answer: stackoverflow.com/a/39689037/1766230 -- They prioritize users over developers.

                    – Luke
                    Sep 25 '16 at 16:18






                  • 5





                    If you would like to provide the Chrome team with valid reasons for using autocomplete="off" please do so here: bugs.chromium.org/p/chromium/issues/detail?id=587466

                    – Chris
                    Oct 16 '16 at 13:33








                  • 8





                    Chrome version 71 ignores all autocomplete attributes on form and input.

                    – Digggid
                    Dec 30 '18 at 20:46











                  • @Digggid Chrome 71 doesn't ignore the attribute, but in some cases it ignores the "off" value. Using a value like "country" still works for me.

                    – Burak
                    Jan 10 at 9:50

















                  For React use 'autoComplete=off.'

                  – zero_cool
                  Mar 31 '16 at 19:10





                  For React use 'autoComplete=off.'

                  – zero_cool
                  Mar 31 '16 at 19:10













                  For an explanation of why Chrome made this change, see this answer: stackoverflow.com/a/39689037/1766230 -- They prioritize users over developers.

                  – Luke
                  Sep 25 '16 at 16:18





                  For an explanation of why Chrome made this change, see this answer: stackoverflow.com/a/39689037/1766230 -- They prioritize users over developers.

                  – Luke
                  Sep 25 '16 at 16:18




                  5




                  5





                  If you would like to provide the Chrome team with valid reasons for using autocomplete="off" please do so here: bugs.chromium.org/p/chromium/issues/detail?id=587466

                  – Chris
                  Oct 16 '16 at 13:33







                  If you would like to provide the Chrome team with valid reasons for using autocomplete="off" please do so here: bugs.chromium.org/p/chromium/issues/detail?id=587466

                  – Chris
                  Oct 16 '16 at 13:33






                  8




                  8





                  Chrome version 71 ignores all autocomplete attributes on form and input.

                  – Digggid
                  Dec 30 '18 at 20:46





                  Chrome version 71 ignores all autocomplete attributes on form and input.

                  – Digggid
                  Dec 30 '18 at 20:46













                  @Digggid Chrome 71 doesn't ignore the attribute, but in some cases it ignores the "off" value. Using a value like "country" still works for me.

                  – Burak
                  Jan 10 at 9:50





                  @Digggid Chrome 71 doesn't ignore the attribute, but in some cases it ignores the "off" value. Using a value like "country" still works for me.

                  – Burak
                  Jan 10 at 9:50











                  68














                  For a reliable workaround, you can add this code to your layout page:



                  <div style="display: none;">
                  <input type="text" id="PreventChromeAutocomplete"
                  name="PreventChromeAutocomplete" autocomplete="address-level4" />
                  </div>


                  Chrome respects autocomplete=off only when there is at least one other input element in the form with any other autocomplete value.



                  This will not work with password fields--those are handled very differently in Chrome. See https://code.google.com/p/chromium/issues/detail?id=468153 for more details.



                  UPDATE: Bug closed as "Won't Fix" by Chromium Team March 11, 2016. See last comment in my originally filed bug report, for full explanation. TL;DR: use semantic autocomplete attributes such as autocomplete="new-street-address" to avoid Chrome performing autofill.






                  share|improve this answer





















                  • 1





                    @Jonathan Cowley-Thom: try these test pages I put up containing my workaround. On hub.securevideo.com/Support/AutocompleteOn, you should see Chrome autocomplete suggestions. Then, try the same entries on hub.securevideo.com/Support/AutocompleteOff. You should not see Chrome autocomplete suggestions. I just tested this on Chrome 45.0.2454.101m and 46.0.2490.71m, and it worked as expected on both.

                    – J.T. Taylor
                    Oct 14 '15 at 16:21











                  • One more update on this matter: I just received a notification from the Chrome team that this has been fixed. So, hopefully this workaround will very soon no longer be needed!

                    – J.T. Taylor
                    Dec 3 '15 at 23:37











                  • See my post above: "This will not work with password fields--those are handled very differently in Chrome. See code.google.com/p/chromium/issues/detail?id=468153 for more details."

                    – J.T. Taylor
                    Feb 5 '16 at 22:59











                  • The solution works fine with Chrome 49, compare using hub.securevideo.com/Support/AutocompleteOff and hub.securevideo.com/Support/AutocompleteOn. Password autofill is a completely different situation than non-password form autocompletes.

                    – J.T. Taylor
                    Mar 12 '16 at 0:56











                  • autocomplete = "chromepleasedontcompletethis" Fixed.

                    – Izzy
                    Nov 7 '18 at 14:22
















                  68














                  For a reliable workaround, you can add this code to your layout page:



                  <div style="display: none;">
                  <input type="text" id="PreventChromeAutocomplete"
                  name="PreventChromeAutocomplete" autocomplete="address-level4" />
                  </div>


                  Chrome respects autocomplete=off only when there is at least one other input element in the form with any other autocomplete value.



                  This will not work with password fields--those are handled very differently in Chrome. See https://code.google.com/p/chromium/issues/detail?id=468153 for more details.



                  UPDATE: Bug closed as "Won't Fix" by Chromium Team March 11, 2016. See last comment in my originally filed bug report, for full explanation. TL;DR: use semantic autocomplete attributes such as autocomplete="new-street-address" to avoid Chrome performing autofill.






                  share|improve this answer





















                  • 1





                    @Jonathan Cowley-Thom: try these test pages I put up containing my workaround. On hub.securevideo.com/Support/AutocompleteOn, you should see Chrome autocomplete suggestions. Then, try the same entries on hub.securevideo.com/Support/AutocompleteOff. You should not see Chrome autocomplete suggestions. I just tested this on Chrome 45.0.2454.101m and 46.0.2490.71m, and it worked as expected on both.

                    – J.T. Taylor
                    Oct 14 '15 at 16:21











                  • One more update on this matter: I just received a notification from the Chrome team that this has been fixed. So, hopefully this workaround will very soon no longer be needed!

                    – J.T. Taylor
                    Dec 3 '15 at 23:37











                  • See my post above: "This will not work with password fields--those are handled very differently in Chrome. See code.google.com/p/chromium/issues/detail?id=468153 for more details."

                    – J.T. Taylor
                    Feb 5 '16 at 22:59











                  • The solution works fine with Chrome 49, compare using hub.securevideo.com/Support/AutocompleteOff and hub.securevideo.com/Support/AutocompleteOn. Password autofill is a completely different situation than non-password form autocompletes.

                    – J.T. Taylor
                    Mar 12 '16 at 0:56











                  • autocomplete = "chromepleasedontcompletethis" Fixed.

                    – Izzy
                    Nov 7 '18 at 14:22














                  68












                  68








                  68







                  For a reliable workaround, you can add this code to your layout page:



                  <div style="display: none;">
                  <input type="text" id="PreventChromeAutocomplete"
                  name="PreventChromeAutocomplete" autocomplete="address-level4" />
                  </div>


                  Chrome respects autocomplete=off only when there is at least one other input element in the form with any other autocomplete value.



                  This will not work with password fields--those are handled very differently in Chrome. See https://code.google.com/p/chromium/issues/detail?id=468153 for more details.



                  UPDATE: Bug closed as "Won't Fix" by Chromium Team March 11, 2016. See last comment in my originally filed bug report, for full explanation. TL;DR: use semantic autocomplete attributes such as autocomplete="new-street-address" to avoid Chrome performing autofill.






                  share|improve this answer















                  For a reliable workaround, you can add this code to your layout page:



                  <div style="display: none;">
                  <input type="text" id="PreventChromeAutocomplete"
                  name="PreventChromeAutocomplete" autocomplete="address-level4" />
                  </div>


                  Chrome respects autocomplete=off only when there is at least one other input element in the form with any other autocomplete value.



                  This will not work with password fields--those are handled very differently in Chrome. See https://code.google.com/p/chromium/issues/detail?id=468153 for more details.



                  UPDATE: Bug closed as "Won't Fix" by Chromium Team March 11, 2016. See last comment in my originally filed bug report, for full explanation. TL;DR: use semantic autocomplete attributes such as autocomplete="new-street-address" to avoid Chrome performing autofill.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 25 '16 at 11:47









                  matheca

                  93




                  93










                  answered Jun 16 '15 at 16:51









                  J.T. TaylorJ.T. Taylor

                  2,7541621




                  2,7541621








                  • 1





                    @Jonathan Cowley-Thom: try these test pages I put up containing my workaround. On hub.securevideo.com/Support/AutocompleteOn, you should see Chrome autocomplete suggestions. Then, try the same entries on hub.securevideo.com/Support/AutocompleteOff. You should not see Chrome autocomplete suggestions. I just tested this on Chrome 45.0.2454.101m and 46.0.2490.71m, and it worked as expected on both.

                    – J.T. Taylor
                    Oct 14 '15 at 16:21











                  • One more update on this matter: I just received a notification from the Chrome team that this has been fixed. So, hopefully this workaround will very soon no longer be needed!

                    – J.T. Taylor
                    Dec 3 '15 at 23:37











                  • See my post above: "This will not work with password fields--those are handled very differently in Chrome. See code.google.com/p/chromium/issues/detail?id=468153 for more details."

                    – J.T. Taylor
                    Feb 5 '16 at 22:59











                  • The solution works fine with Chrome 49, compare using hub.securevideo.com/Support/AutocompleteOff and hub.securevideo.com/Support/AutocompleteOn. Password autofill is a completely different situation than non-password form autocompletes.

                    – J.T. Taylor
                    Mar 12 '16 at 0:56











                  • autocomplete = "chromepleasedontcompletethis" Fixed.

                    – Izzy
                    Nov 7 '18 at 14:22














                  • 1





                    @Jonathan Cowley-Thom: try these test pages I put up containing my workaround. On hub.securevideo.com/Support/AutocompleteOn, you should see Chrome autocomplete suggestions. Then, try the same entries on hub.securevideo.com/Support/AutocompleteOff. You should not see Chrome autocomplete suggestions. I just tested this on Chrome 45.0.2454.101m and 46.0.2490.71m, and it worked as expected on both.

                    – J.T. Taylor
                    Oct 14 '15 at 16:21











                  • One more update on this matter: I just received a notification from the Chrome team that this has been fixed. So, hopefully this workaround will very soon no longer be needed!

                    – J.T. Taylor
                    Dec 3 '15 at 23:37











                  • See my post above: "This will not work with password fields--those are handled very differently in Chrome. See code.google.com/p/chromium/issues/detail?id=468153 for more details."

                    – J.T. Taylor
                    Feb 5 '16 at 22:59











                  • The solution works fine with Chrome 49, compare using hub.securevideo.com/Support/AutocompleteOff and hub.securevideo.com/Support/AutocompleteOn. Password autofill is a completely different situation than non-password form autocompletes.

                    – J.T. Taylor
                    Mar 12 '16 at 0:56











                  • autocomplete = "chromepleasedontcompletethis" Fixed.

                    – Izzy
                    Nov 7 '18 at 14:22








                  1




                  1





                  @Jonathan Cowley-Thom: try these test pages I put up containing my workaround. On hub.securevideo.com/Support/AutocompleteOn, you should see Chrome autocomplete suggestions. Then, try the same entries on hub.securevideo.com/Support/AutocompleteOff. You should not see Chrome autocomplete suggestions. I just tested this on Chrome 45.0.2454.101m and 46.0.2490.71m, and it worked as expected on both.

                  – J.T. Taylor
                  Oct 14 '15 at 16:21





                  @Jonathan Cowley-Thom: try these test pages I put up containing my workaround. On hub.securevideo.com/Support/AutocompleteOn, you should see Chrome autocomplete suggestions. Then, try the same entries on hub.securevideo.com/Support/AutocompleteOff. You should not see Chrome autocomplete suggestions. I just tested this on Chrome 45.0.2454.101m and 46.0.2490.71m, and it worked as expected on both.

                  – J.T. Taylor
                  Oct 14 '15 at 16:21













                  One more update on this matter: I just received a notification from the Chrome team that this has been fixed. So, hopefully this workaround will very soon no longer be needed!

                  – J.T. Taylor
                  Dec 3 '15 at 23:37





                  One more update on this matter: I just received a notification from the Chrome team that this has been fixed. So, hopefully this workaround will very soon no longer be needed!

                  – J.T. Taylor
                  Dec 3 '15 at 23:37













                  See my post above: "This will not work with password fields--those are handled very differently in Chrome. See code.google.com/p/chromium/issues/detail?id=468153 for more details."

                  – J.T. Taylor
                  Feb 5 '16 at 22:59





                  See my post above: "This will not work with password fields--those are handled very differently in Chrome. See code.google.com/p/chromium/issues/detail?id=468153 for more details."

                  – J.T. Taylor
                  Feb 5 '16 at 22:59













                  The solution works fine with Chrome 49, compare using hub.securevideo.com/Support/AutocompleteOff and hub.securevideo.com/Support/AutocompleteOn. Password autofill is a completely different situation than non-password form autocompletes.

                  – J.T. Taylor
                  Mar 12 '16 at 0:56





                  The solution works fine with Chrome 49, compare using hub.securevideo.com/Support/AutocompleteOff and hub.securevideo.com/Support/AutocompleteOn. Password autofill is a completely different situation than non-password form autocompletes.

                  – J.T. Taylor
                  Mar 12 '16 at 0:56













                  autocomplete = "chromepleasedontcompletethis" Fixed.

                  – Izzy
                  Nov 7 '18 at 14:22





                  autocomplete = "chromepleasedontcompletethis" Fixed.

                  – Izzy
                  Nov 7 '18 at 14:22











                  47














                  Modern Approach



                  Simply make your input readonly, and on focus, remove it. This is a very simple approach and browsers will not populate readonly inputs. Therefore, this method is accepted and will never be overwritten by future browser updates.



                  <input type="text" onfocus="this.removeAttribute('readonly');" readonly />


                  The next part is optional. Style your input accordingly so that it does not look like a readonly input.



                  input[readonly] {
                  cursor: text;
                  background-color: #fff;
                  }


                  WORKING EXAMPLE






                  share|improve this answer





















                  • 27





                    @Basit - And that's why I called it a modern approach. Less than 1% of users in the world have Javascript turned off. So honestly, it's not worth anyones time accommodating for such a small audience when a large majority of websites rely on Javascript. Been developing websites for a very long time now, and 100% of my sites use Javascript and rely on it heavily. If users have Javascript turned off, that's their own problem and choice, not mine. They'll be unable to visit or use at least 90% of websites online with it turned off... Your downvote is completely irrelevant.

                    – Fizzix
                    Nov 4 '15 at 0:11






                  • 9





                    This does not work today in 49. Chrome "developers" is watching stackoverflow solutions and removing them.

                    – puchu
                    Apr 14 '16 at 13:55











                  • @puchu - I'm using Chrome 49 and it's working perfectly fine? Use the following example, enter in a username and password, click 'Submit', save them to your Chrome saved credentials, reload the page, and you will notice that they are not auto filled - jsfiddle.net/w0wxy9ao/18

                    – Fizzix
                    Apr 18 '16 at 1:00






                  • 6





                    This answer from September 2015 is basically a copy from the answer in November 2014 down below.

                    – dsuess
                    Dec 14 '16 at 11:01
















                  47














                  Modern Approach



                  Simply make your input readonly, and on focus, remove it. This is a very simple approach and browsers will not populate readonly inputs. Therefore, this method is accepted and will never be overwritten by future browser updates.



                  <input type="text" onfocus="this.removeAttribute('readonly');" readonly />


                  The next part is optional. Style your input accordingly so that it does not look like a readonly input.



                  input[readonly] {
                  cursor: text;
                  background-color: #fff;
                  }


                  WORKING EXAMPLE






                  share|improve this answer





















                  • 27





                    @Basit - And that's why I called it a modern approach. Less than 1% of users in the world have Javascript turned off. So honestly, it's not worth anyones time accommodating for such a small audience when a large majority of websites rely on Javascript. Been developing websites for a very long time now, and 100% of my sites use Javascript and rely on it heavily. If users have Javascript turned off, that's their own problem and choice, not mine. They'll be unable to visit or use at least 90% of websites online with it turned off... Your downvote is completely irrelevant.

                    – Fizzix
                    Nov 4 '15 at 0:11






                  • 9





                    This does not work today in 49. Chrome "developers" is watching stackoverflow solutions and removing them.

                    – puchu
                    Apr 14 '16 at 13:55











                  • @puchu - I'm using Chrome 49 and it's working perfectly fine? Use the following example, enter in a username and password, click 'Submit', save them to your Chrome saved credentials, reload the page, and you will notice that they are not auto filled - jsfiddle.net/w0wxy9ao/18

                    – Fizzix
                    Apr 18 '16 at 1:00






                  • 6





                    This answer from September 2015 is basically a copy from the answer in November 2014 down below.

                    – dsuess
                    Dec 14 '16 at 11:01














                  47












                  47








                  47







                  Modern Approach



                  Simply make your input readonly, and on focus, remove it. This is a very simple approach and browsers will not populate readonly inputs. Therefore, this method is accepted and will never be overwritten by future browser updates.



                  <input type="text" onfocus="this.removeAttribute('readonly');" readonly />


                  The next part is optional. Style your input accordingly so that it does not look like a readonly input.



                  input[readonly] {
                  cursor: text;
                  background-color: #fff;
                  }


                  WORKING EXAMPLE






                  share|improve this answer















                  Modern Approach



                  Simply make your input readonly, and on focus, remove it. This is a very simple approach and browsers will not populate readonly inputs. Therefore, this method is accepted and will never be overwritten by future browser updates.



                  <input type="text" onfocus="this.removeAttribute('readonly');" readonly />


                  The next part is optional. Style your input accordingly so that it does not look like a readonly input.



                  input[readonly] {
                  cursor: text;
                  background-color: #fff;
                  }


                  WORKING EXAMPLE







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 13 '18 at 3:30

























                  answered Sep 15 '15 at 5:55









                  FizzixFizzix

                  12.6k2686136




                  12.6k2686136








                  • 27





                    @Basit - And that's why I called it a modern approach. Less than 1% of users in the world have Javascript turned off. So honestly, it's not worth anyones time accommodating for such a small audience when a large majority of websites rely on Javascript. Been developing websites for a very long time now, and 100% of my sites use Javascript and rely on it heavily. If users have Javascript turned off, that's their own problem and choice, not mine. They'll be unable to visit or use at least 90% of websites online with it turned off... Your downvote is completely irrelevant.

                    – Fizzix
                    Nov 4 '15 at 0:11






                  • 9





                    This does not work today in 49. Chrome "developers" is watching stackoverflow solutions and removing them.

                    – puchu
                    Apr 14 '16 at 13:55











                  • @puchu - I'm using Chrome 49 and it's working perfectly fine? Use the following example, enter in a username and password, click 'Submit', save them to your Chrome saved credentials, reload the page, and you will notice that they are not auto filled - jsfiddle.net/w0wxy9ao/18

                    – Fizzix
                    Apr 18 '16 at 1:00






                  • 6





                    This answer from September 2015 is basically a copy from the answer in November 2014 down below.

                    – dsuess
                    Dec 14 '16 at 11:01














                  • 27





                    @Basit - And that's why I called it a modern approach. Less than 1% of users in the world have Javascript turned off. So honestly, it's not worth anyones time accommodating for such a small audience when a large majority of websites rely on Javascript. Been developing websites for a very long time now, and 100% of my sites use Javascript and rely on it heavily. If users have Javascript turned off, that's their own problem and choice, not mine. They'll be unable to visit or use at least 90% of websites online with it turned off... Your downvote is completely irrelevant.

                    – Fizzix
                    Nov 4 '15 at 0:11






                  • 9





                    This does not work today in 49. Chrome "developers" is watching stackoverflow solutions and removing them.

                    – puchu
                    Apr 14 '16 at 13:55











                  • @puchu - I'm using Chrome 49 and it's working perfectly fine? Use the following example, enter in a username and password, click 'Submit', save them to your Chrome saved credentials, reload the page, and you will notice that they are not auto filled - jsfiddle.net/w0wxy9ao/18

                    – Fizzix
                    Apr 18 '16 at 1:00






                  • 6





                    This answer from September 2015 is basically a copy from the answer in November 2014 down below.

                    – dsuess
                    Dec 14 '16 at 11:01








                  27




                  27





                  @Basit - And that's why I called it a modern approach. Less than 1% of users in the world have Javascript turned off. So honestly, it's not worth anyones time accommodating for such a small audience when a large majority of websites rely on Javascript. Been developing websites for a very long time now, and 100% of my sites use Javascript and rely on it heavily. If users have Javascript turned off, that's their own problem and choice, not mine. They'll be unable to visit or use at least 90% of websites online with it turned off... Your downvote is completely irrelevant.

                  – Fizzix
                  Nov 4 '15 at 0:11





                  @Basit - And that's why I called it a modern approach. Less than 1% of users in the world have Javascript turned off. So honestly, it's not worth anyones time accommodating for such a small audience when a large majority of websites rely on Javascript. Been developing websites for a very long time now, and 100% of my sites use Javascript and rely on it heavily. If users have Javascript turned off, that's their own problem and choice, not mine. They'll be unable to visit or use at least 90% of websites online with it turned off... Your downvote is completely irrelevant.

                  – Fizzix
                  Nov 4 '15 at 0:11




                  9




                  9





                  This does not work today in 49. Chrome "developers" is watching stackoverflow solutions and removing them.

                  – puchu
                  Apr 14 '16 at 13:55





                  This does not work today in 49. Chrome "developers" is watching stackoverflow solutions and removing them.

                  – puchu
                  Apr 14 '16 at 13:55













                  @puchu - I'm using Chrome 49 and it's working perfectly fine? Use the following example, enter in a username and password, click 'Submit', save them to your Chrome saved credentials, reload the page, and you will notice that they are not auto filled - jsfiddle.net/w0wxy9ao/18

                  – Fizzix
                  Apr 18 '16 at 1:00





                  @puchu - I'm using Chrome 49 and it's working perfectly fine? Use the following example, enter in a username and password, click 'Submit', save them to your Chrome saved credentials, reload the page, and you will notice that they are not auto filled - jsfiddle.net/w0wxy9ao/18

                  – Fizzix
                  Apr 18 '16 at 1:00




                  6




                  6





                  This answer from September 2015 is basically a copy from the answer in November 2014 down below.

                  – dsuess
                  Dec 14 '16 at 11:01





                  This answer from September 2015 is basically a copy from the answer in November 2014 down below.

                  – dsuess
                  Dec 14 '16 at 11:01











                  31














                  Chrome version 34 now ignores the autocomplete=off,
                  see this.



                  Lots of discussion on whether this is a good thing or a bad thing? Whats your views?






                  share|improve this answer





















                  • 1





                    sorry for the downvote ... this is not a discussion site (try quora instead), and you don't provide an answer. Thanks for the link though.

                    – commonpike
                    Mar 11 at 19:36
















                  31














                  Chrome version 34 now ignores the autocomplete=off,
                  see this.



                  Lots of discussion on whether this is a good thing or a bad thing? Whats your views?






                  share|improve this answer





















                  • 1





                    sorry for the downvote ... this is not a discussion site (try quora instead), and you don't provide an answer. Thanks for the link though.

                    – commonpike
                    Mar 11 at 19:36














                  31












                  31








                  31







                  Chrome version 34 now ignores the autocomplete=off,
                  see this.



                  Lots of discussion on whether this is a good thing or a bad thing? Whats your views?






                  share|improve this answer















                  Chrome version 34 now ignores the autocomplete=off,
                  see this.



                  Lots of discussion on whether this is a good thing or a bad thing? Whats your views?







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 25 '16 at 11:48









                  matheca

                  93




                  93










                  answered Apr 9 '14 at 9:11









                  Peter KerrPeter Kerr

                  9481323




                  9481323








                  • 1





                    sorry for the downvote ... this is not a discussion site (try quora instead), and you don't provide an answer. Thanks for the link though.

                    – commonpike
                    Mar 11 at 19:36














                  • 1





                    sorry for the downvote ... this is not a discussion site (try quora instead), and you don't provide an answer. Thanks for the link though.

                    – commonpike
                    Mar 11 at 19:36








                  1




                  1





                  sorry for the downvote ... this is not a discussion site (try quora instead), and you don't provide an answer. Thanks for the link though.

                  – commonpike
                  Mar 11 at 19:36





                  sorry for the downvote ... this is not a discussion site (try quora instead), and you don't provide an answer. Thanks for the link though.

                  – commonpike
                  Mar 11 at 19:36











                  29














                  The solution at present is to use type="search". Google doesn't apply autofill to inputs with a type of search.



                  See: https://twitter.com/Paul_Kinlan/status/596613148985171968



                  Update 04/04/2016: Looks like this is fixed! See http://codereview.chromium.org/1473733008






                  share|improve this answer


























                  • this is not true as v73

                    – Miguel
                    Mar 27 at 17:14
















                  29














                  The solution at present is to use type="search". Google doesn't apply autofill to inputs with a type of search.



                  See: https://twitter.com/Paul_Kinlan/status/596613148985171968



                  Update 04/04/2016: Looks like this is fixed! See http://codereview.chromium.org/1473733008






                  share|improve this answer


























                  • this is not true as v73

                    – Miguel
                    Mar 27 at 17:14














                  29












                  29








                  29







                  The solution at present is to use type="search". Google doesn't apply autofill to inputs with a type of search.



                  See: https://twitter.com/Paul_Kinlan/status/596613148985171968



                  Update 04/04/2016: Looks like this is fixed! See http://codereview.chromium.org/1473733008






                  share|improve this answer















                  The solution at present is to use type="search". Google doesn't apply autofill to inputs with a type of search.



                  See: https://twitter.com/Paul_Kinlan/status/596613148985171968



                  Update 04/04/2016: Looks like this is fixed! See http://codereview.chromium.org/1473733008







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 14 '16 at 13:53

























                  answered May 8 '15 at 10:53









                  Nathan PitmanNathan Pitman

                  1,29732139




                  1,29732139













                  • this is not true as v73

                    – Miguel
                    Mar 27 at 17:14



















                  • this is not true as v73

                    – Miguel
                    Mar 27 at 17:14

















                  this is not true as v73

                  – Miguel
                  Mar 27 at 17:14





                  this is not true as v73

                  – Miguel
                  Mar 27 at 17:14











                  29














                  Well, a little late to the party, but it seems that there is a bit of misunderstanding about how autocomplete should and shouldn't work. According to the HTML specifications, the user agent (in this case Chrome) can override autocomplete:



                  https://www.w3.org/TR/html5/forms.html#autofilling-form-controls:-the-autocomplete-attribute




                  A user agent may allow the user to override an element's autofill field name, e.g. to change it from "off" to "on" to allow values to be remembered and prefilled despite the page author's objections, or to always "off", never remembering values. However, user agents should not allow users to trivially override the autofill field name from "off" to "on" or other values, as there are significant security implications for the user if all values are always remembered, regardless of the site's preferences.




                  So in the case of Chrome, the developers have essentially said "we will leave this to the user to decide in their preferences whether they want autocomplete to work or not. If you don't want it, don't enable it in your browser".



                  However, it appears that this is a little over-zealous on their part for my liking, but it is the way it is. The specification also discusses the potential security implications of such a move:




                  The "off" keyword indicates either that the control's input data is particularly sensitive (for example the activation code for a nuclear weapon); or that it is a value that will never be reused (for example a one-time-key for a bank login) and the user will therefore have to explicitly enter the data each time, instead of being able to rely on the UA to prefill the value for him; or that the document provides its own autocomplete mechanism and does not want the user agent to provide autocompletion values.




                  So after experiencing the same frustration as everyone else, I found a solution that works for me. It is similar in vein to the autocomplete="false" answers.



                  A Mozilla article speaks to exactly this problem:



                  https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion




                  In some case, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really force the no-completion is to assign a random string to the attribute




                  So the following code should work:



                  autocomplete="nope"


                  And so should each of the following:



                  autocomplete="false"
                  autocomplete="foo"
                  autocomplete="bar"


                  The issue I see is that the browser agent might be smart enough to learn the autocomplete attribute and apply it next time it sees the form. If it does do this, the only way I can see to still get around the problem would be to dynamically change the autocomplete attribute value when the page is generated.



                  One point worth mentioning is that many browser will ignore autocomplete settings for login fields (username and password). As the Mozilla article states:




                  For this reason, many modern browsers do not support autocomplete="off" for login fields.




                  • If a site sets autocomplete="off" for a form, and the form includes username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.

                  • If a site sets autocomplete="off" for username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.


                  This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).




                  Finally a little info on whether the attribute belongs on the form element or the input element. The spec again has the answer:




                  If the autocomplete attribute is omitted, the default value corresponding to the state of the element's form owner's autocomplete attribute is used instead (either "on" or "off"). If there is no form owner, then the value "on" is used.




                  So. Putting it on the form should apply to all input fields. Putting it on an individual element should apply to just that element (even if there isn't one on the form). If autocomplete isn't set at all, it defaults to on.



                  Summary



                  To disable autocomplete on the whole form:



                  <form autocomplete="off" ...>


                  Or if you dynamically need to do it:



                  <form autocomplete="random-string" ...>


                  To disable autocomplete on an individual element (regardless of the form setting being present or not)



                  <input autocomplete="off" ...>


                  Or if you dynamically need to do it:



                  <input autocomplete="random-string" ...>


                  And remember that certain user agents can override even your hardest fought attempts to disable autocomplete.






                  share|improve this answer






























                    29














                    Well, a little late to the party, but it seems that there is a bit of misunderstanding about how autocomplete should and shouldn't work. According to the HTML specifications, the user agent (in this case Chrome) can override autocomplete:



                    https://www.w3.org/TR/html5/forms.html#autofilling-form-controls:-the-autocomplete-attribute




                    A user agent may allow the user to override an element's autofill field name, e.g. to change it from "off" to "on" to allow values to be remembered and prefilled despite the page author's objections, or to always "off", never remembering values. However, user agents should not allow users to trivially override the autofill field name from "off" to "on" or other values, as there are significant security implications for the user if all values are always remembered, regardless of the site's preferences.




                    So in the case of Chrome, the developers have essentially said "we will leave this to the user to decide in their preferences whether they want autocomplete to work or not. If you don't want it, don't enable it in your browser".



                    However, it appears that this is a little over-zealous on their part for my liking, but it is the way it is. The specification also discusses the potential security implications of such a move:




                    The "off" keyword indicates either that the control's input data is particularly sensitive (for example the activation code for a nuclear weapon); or that it is a value that will never be reused (for example a one-time-key for a bank login) and the user will therefore have to explicitly enter the data each time, instead of being able to rely on the UA to prefill the value for him; or that the document provides its own autocomplete mechanism and does not want the user agent to provide autocompletion values.




                    So after experiencing the same frustration as everyone else, I found a solution that works for me. It is similar in vein to the autocomplete="false" answers.



                    A Mozilla article speaks to exactly this problem:



                    https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion




                    In some case, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really force the no-completion is to assign a random string to the attribute




                    So the following code should work:



                    autocomplete="nope"


                    And so should each of the following:



                    autocomplete="false"
                    autocomplete="foo"
                    autocomplete="bar"


                    The issue I see is that the browser agent might be smart enough to learn the autocomplete attribute and apply it next time it sees the form. If it does do this, the only way I can see to still get around the problem would be to dynamically change the autocomplete attribute value when the page is generated.



                    One point worth mentioning is that many browser will ignore autocomplete settings for login fields (username and password). As the Mozilla article states:




                    For this reason, many modern browsers do not support autocomplete="off" for login fields.




                    • If a site sets autocomplete="off" for a form, and the form includes username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.

                    • If a site sets autocomplete="off" for username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.


                    This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).




                    Finally a little info on whether the attribute belongs on the form element or the input element. The spec again has the answer:




                    If the autocomplete attribute is omitted, the default value corresponding to the state of the element's form owner's autocomplete attribute is used instead (either "on" or "off"). If there is no form owner, then the value "on" is used.




                    So. Putting it on the form should apply to all input fields. Putting it on an individual element should apply to just that element (even if there isn't one on the form). If autocomplete isn't set at all, it defaults to on.



                    Summary



                    To disable autocomplete on the whole form:



                    <form autocomplete="off" ...>


                    Or if you dynamically need to do it:



                    <form autocomplete="random-string" ...>


                    To disable autocomplete on an individual element (regardless of the form setting being present or not)



                    <input autocomplete="off" ...>


                    Or if you dynamically need to do it:



                    <input autocomplete="random-string" ...>


                    And remember that certain user agents can override even your hardest fought attempts to disable autocomplete.






                    share|improve this answer




























                      29












                      29








                      29







                      Well, a little late to the party, but it seems that there is a bit of misunderstanding about how autocomplete should and shouldn't work. According to the HTML specifications, the user agent (in this case Chrome) can override autocomplete:



                      https://www.w3.org/TR/html5/forms.html#autofilling-form-controls:-the-autocomplete-attribute




                      A user agent may allow the user to override an element's autofill field name, e.g. to change it from "off" to "on" to allow values to be remembered and prefilled despite the page author's objections, or to always "off", never remembering values. However, user agents should not allow users to trivially override the autofill field name from "off" to "on" or other values, as there are significant security implications for the user if all values are always remembered, regardless of the site's preferences.




                      So in the case of Chrome, the developers have essentially said "we will leave this to the user to decide in their preferences whether they want autocomplete to work or not. If you don't want it, don't enable it in your browser".



                      However, it appears that this is a little over-zealous on their part for my liking, but it is the way it is. The specification also discusses the potential security implications of such a move:




                      The "off" keyword indicates either that the control's input data is particularly sensitive (for example the activation code for a nuclear weapon); or that it is a value that will never be reused (for example a one-time-key for a bank login) and the user will therefore have to explicitly enter the data each time, instead of being able to rely on the UA to prefill the value for him; or that the document provides its own autocomplete mechanism and does not want the user agent to provide autocompletion values.




                      So after experiencing the same frustration as everyone else, I found a solution that works for me. It is similar in vein to the autocomplete="false" answers.



                      A Mozilla article speaks to exactly this problem:



                      https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion




                      In some case, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really force the no-completion is to assign a random string to the attribute




                      So the following code should work:



                      autocomplete="nope"


                      And so should each of the following:



                      autocomplete="false"
                      autocomplete="foo"
                      autocomplete="bar"


                      The issue I see is that the browser agent might be smart enough to learn the autocomplete attribute and apply it next time it sees the form. If it does do this, the only way I can see to still get around the problem would be to dynamically change the autocomplete attribute value when the page is generated.



                      One point worth mentioning is that many browser will ignore autocomplete settings for login fields (username and password). As the Mozilla article states:




                      For this reason, many modern browsers do not support autocomplete="off" for login fields.




                      • If a site sets autocomplete="off" for a form, and the form includes username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.

                      • If a site sets autocomplete="off" for username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.


                      This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).




                      Finally a little info on whether the attribute belongs on the form element or the input element. The spec again has the answer:




                      If the autocomplete attribute is omitted, the default value corresponding to the state of the element's form owner's autocomplete attribute is used instead (either "on" or "off"). If there is no form owner, then the value "on" is used.




                      So. Putting it on the form should apply to all input fields. Putting it on an individual element should apply to just that element (even if there isn't one on the form). If autocomplete isn't set at all, it defaults to on.



                      Summary



                      To disable autocomplete on the whole form:



                      <form autocomplete="off" ...>


                      Or if you dynamically need to do it:



                      <form autocomplete="random-string" ...>


                      To disable autocomplete on an individual element (regardless of the form setting being present or not)



                      <input autocomplete="off" ...>


                      Or if you dynamically need to do it:



                      <input autocomplete="random-string" ...>


                      And remember that certain user agents can override even your hardest fought attempts to disable autocomplete.






                      share|improve this answer















                      Well, a little late to the party, but it seems that there is a bit of misunderstanding about how autocomplete should and shouldn't work. According to the HTML specifications, the user agent (in this case Chrome) can override autocomplete:



                      https://www.w3.org/TR/html5/forms.html#autofilling-form-controls:-the-autocomplete-attribute




                      A user agent may allow the user to override an element's autofill field name, e.g. to change it from "off" to "on" to allow values to be remembered and prefilled despite the page author's objections, or to always "off", never remembering values. However, user agents should not allow users to trivially override the autofill field name from "off" to "on" or other values, as there are significant security implications for the user if all values are always remembered, regardless of the site's preferences.




                      So in the case of Chrome, the developers have essentially said "we will leave this to the user to decide in their preferences whether they want autocomplete to work or not. If you don't want it, don't enable it in your browser".



                      However, it appears that this is a little over-zealous on their part for my liking, but it is the way it is. The specification also discusses the potential security implications of such a move:




                      The "off" keyword indicates either that the control's input data is particularly sensitive (for example the activation code for a nuclear weapon); or that it is a value that will never be reused (for example a one-time-key for a bank login) and the user will therefore have to explicitly enter the data each time, instead of being able to rely on the UA to prefill the value for him; or that the document provides its own autocomplete mechanism and does not want the user agent to provide autocompletion values.




                      So after experiencing the same frustration as everyone else, I found a solution that works for me. It is similar in vein to the autocomplete="false" answers.



                      A Mozilla article speaks to exactly this problem:



                      https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion




                      In some case, the browser will keep suggesting autocompletion values even if the autocomplete attribute is set to off. This unexpected behavior can be quite puzzling for developers. The trick to really force the no-completion is to assign a random string to the attribute




                      So the following code should work:



                      autocomplete="nope"


                      And so should each of the following:



                      autocomplete="false"
                      autocomplete="foo"
                      autocomplete="bar"


                      The issue I see is that the browser agent might be smart enough to learn the autocomplete attribute and apply it next time it sees the form. If it does do this, the only way I can see to still get around the problem would be to dynamically change the autocomplete attribute value when the page is generated.



                      One point worth mentioning is that many browser will ignore autocomplete settings for login fields (username and password). As the Mozilla article states:




                      For this reason, many modern browsers do not support autocomplete="off" for login fields.




                      • If a site sets autocomplete="off" for a form, and the form includes username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.

                      • If a site sets autocomplete="off" for username and password input fields, then the browser will still offer to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits this page.


                      This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).




                      Finally a little info on whether the attribute belongs on the form element or the input element. The spec again has the answer:




                      If the autocomplete attribute is omitted, the default value corresponding to the state of the element's form owner's autocomplete attribute is used instead (either "on" or "off"). If there is no form owner, then the value "on" is used.




                      So. Putting it on the form should apply to all input fields. Putting it on an individual element should apply to just that element (even if there isn't one on the form). If autocomplete isn't set at all, it defaults to on.



                      Summary



                      To disable autocomplete on the whole form:



                      <form autocomplete="off" ...>


                      Or if you dynamically need to do it:



                      <form autocomplete="random-string" ...>


                      To disable autocomplete on an individual element (regardless of the form setting being present or not)



                      <input autocomplete="off" ...>


                      Or if you dynamically need to do it:



                      <input autocomplete="random-string" ...>


                      And remember that certain user agents can override even your hardest fought attempts to disable autocomplete.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited May 25 '16 at 5:55









                      Cubicle.Jockey

                      2,4411329




                      2,4411329










                      answered Jan 25 '16 at 17:40









                      HooligancatHooligancat

                      1,77512952




                      1,77512952























                          23














                          Browser does not care about autocomplete=off auto or even fills credentials to wrong text field?



                          I fixed it by setting the password field to read-only and activate it, when user clicks into it or uses tab-key to this field.



                          fix browser autofill in: readonly and set writeble on focus (at mouse click and tabbing through fields)



                           <input type="password" readonly  
                          onfocus="$(this).removeAttr('readonly');"/>


                          Update:
                          Mobile Safari sets cursor in the field, but does not show virtual keyboard. New Fix works like before but handles virtual keyboard:



                          <input id="email" readonly type="email" onfocus="if (this.hasAttribute('readonly')) {
                          this.removeAttribute('readonly');
                          // fix for mobile safari to show virtual keyboard
                          this.blur(); this.focus(); }" />


                          Live Demo https://jsfiddle.net/danielsuess/n0scguv6/



                          // UpdateEnd



                          By the way, more information on my observation:



                          Sometimes I notice this strange behavior on Chrome and Safari, when there are password fields in the same form. I guess, the browser looks for a password field to insert your saved credentials. Then it autofills username into the nearest textlike-input field , that appears prior the password field in DOM (just guessing due to observation). As the browser is the last instance and you can not control it, sometimes even autocomplete=off would not prevent to fill in credentials into wrong fields, but not user or nickname field.






                          share|improve this answer





















                          • 2





                            rather than using onfocus, I use a setTimeout to clear the readonly, so my users don't see the input is read only and never focus it!

                            – Hippyjim
                            Mar 3 '15 at 10:10






                          • 1





                            This works in Chrome v44.0.2403.125 m

                            – OutstandingBill
                            Aug 11 '15 at 3:26











                          • IMO Chrome is being WAY too helpful in autocomplete. I mean, ignoring autocomplete='off', wtf?! Thankfully, your solution worked. Still, WTF! Why wouldn't they trust the developer. If their form isn't auto-completed, it should be on the developer, not the browser to fix it.

                            – Funkodebat
                            Dec 6 '16 at 18:53
















                          23














                          Browser does not care about autocomplete=off auto or even fills credentials to wrong text field?



                          I fixed it by setting the password field to read-only and activate it, when user clicks into it or uses tab-key to this field.



                          fix browser autofill in: readonly and set writeble on focus (at mouse click and tabbing through fields)



                           <input type="password" readonly  
                          onfocus="$(this).removeAttr('readonly');"/>


                          Update:
                          Mobile Safari sets cursor in the field, but does not show virtual keyboard. New Fix works like before but handles virtual keyboard:



                          <input id="email" readonly type="email" onfocus="if (this.hasAttribute('readonly')) {
                          this.removeAttribute('readonly');
                          // fix for mobile safari to show virtual keyboard
                          this.blur(); this.focus(); }" />


                          Live Demo https://jsfiddle.net/danielsuess/n0scguv6/



                          // UpdateEnd



                          By the way, more information on my observation:



                          Sometimes I notice this strange behavior on Chrome and Safari, when there are password fields in the same form. I guess, the browser looks for a password field to insert your saved credentials. Then it autofills username into the nearest textlike-input field , that appears prior the password field in DOM (just guessing due to observation). As the browser is the last instance and you can not control it, sometimes even autocomplete=off would not prevent to fill in credentials into wrong fields, but not user or nickname field.






                          share|improve this answer





















                          • 2





                            rather than using onfocus, I use a setTimeout to clear the readonly, so my users don't see the input is read only and never focus it!

                            – Hippyjim
                            Mar 3 '15 at 10:10






                          • 1





                            This works in Chrome v44.0.2403.125 m

                            – OutstandingBill
                            Aug 11 '15 at 3:26











                          • IMO Chrome is being WAY too helpful in autocomplete. I mean, ignoring autocomplete='off', wtf?! Thankfully, your solution worked. Still, WTF! Why wouldn't they trust the developer. If their form isn't auto-completed, it should be on the developer, not the browser to fix it.

                            – Funkodebat
                            Dec 6 '16 at 18:53














                          23












                          23








                          23







                          Browser does not care about autocomplete=off auto or even fills credentials to wrong text field?



                          I fixed it by setting the password field to read-only and activate it, when user clicks into it or uses tab-key to this field.



                          fix browser autofill in: readonly and set writeble on focus (at mouse click and tabbing through fields)



                           <input type="password" readonly  
                          onfocus="$(this).removeAttr('readonly');"/>


                          Update:
                          Mobile Safari sets cursor in the field, but does not show virtual keyboard. New Fix works like before but handles virtual keyboard:



                          <input id="email" readonly type="email" onfocus="if (this.hasAttribute('readonly')) {
                          this.removeAttribute('readonly');
                          // fix for mobile safari to show virtual keyboard
                          this.blur(); this.focus(); }" />


                          Live Demo https://jsfiddle.net/danielsuess/n0scguv6/



                          // UpdateEnd



                          By the way, more information on my observation:



                          Sometimes I notice this strange behavior on Chrome and Safari, when there are password fields in the same form. I guess, the browser looks for a password field to insert your saved credentials. Then it autofills username into the nearest textlike-input field , that appears prior the password field in DOM (just guessing due to observation). As the browser is the last instance and you can not control it, sometimes even autocomplete=off would not prevent to fill in credentials into wrong fields, but not user or nickname field.






                          share|improve this answer















                          Browser does not care about autocomplete=off auto or even fills credentials to wrong text field?



                          I fixed it by setting the password field to read-only and activate it, when user clicks into it or uses tab-key to this field.



                          fix browser autofill in: readonly and set writeble on focus (at mouse click and tabbing through fields)



                           <input type="password" readonly  
                          onfocus="$(this).removeAttr('readonly');"/>


                          Update:
                          Mobile Safari sets cursor in the field, but does not show virtual keyboard. New Fix works like before but handles virtual keyboard:



                          <input id="email" readonly type="email" onfocus="if (this.hasAttribute('readonly')) {
                          this.removeAttribute('readonly');
                          // fix for mobile safari to show virtual keyboard
                          this.blur(); this.focus(); }" />


                          Live Demo https://jsfiddle.net/danielsuess/n0scguv6/



                          // UpdateEnd



                          By the way, more information on my observation:



                          Sometimes I notice this strange behavior on Chrome and Safari, when there are password fields in the same form. I guess, the browser looks for a password field to insert your saved credentials. Then it autofills username into the nearest textlike-input field , that appears prior the password field in DOM (just guessing due to observation). As the browser is the last instance and you can not control it, sometimes even autocomplete=off would not prevent to fill in credentials into wrong fields, but not user or nickname field.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Oct 30 '16 at 13:38

























                          answered Nov 14 '14 at 13:59









                          dsuessdsuess

                          3,84511521




                          3,84511521








                          • 2





                            rather than using onfocus, I use a setTimeout to clear the readonly, so my users don't see the input is read only and never focus it!

                            – Hippyjim
                            Mar 3 '15 at 10:10






                          • 1





                            This works in Chrome v44.0.2403.125 m

                            – OutstandingBill
                            Aug 11 '15 at 3:26











                          • IMO Chrome is being WAY too helpful in autocomplete. I mean, ignoring autocomplete='off', wtf?! Thankfully, your solution worked. Still, WTF! Why wouldn't they trust the developer. If their form isn't auto-completed, it should be on the developer, not the browser to fix it.

                            – Funkodebat
                            Dec 6 '16 at 18:53














                          • 2





                            rather than using onfocus, I use a setTimeout to clear the readonly, so my users don't see the input is read only and never focus it!

                            – Hippyjim
                            Mar 3 '15 at 10:10






                          • 1





                            This works in Chrome v44.0.2403.125 m

                            – OutstandingBill
                            Aug 11 '15 at 3:26











                          • IMO Chrome is being WAY too helpful in autocomplete. I mean, ignoring autocomplete='off', wtf?! Thankfully, your solution worked. Still, WTF! Why wouldn't they trust the developer. If their form isn't auto-completed, it should be on the developer, not the browser to fix it.

                            – Funkodebat
                            Dec 6 '16 at 18:53








                          2




                          2





                          rather than using onfocus, I use a setTimeout to clear the readonly, so my users don't see the input is read only and never focus it!

                          – Hippyjim
                          Mar 3 '15 at 10:10





                          rather than using onfocus, I use a setTimeout to clear the readonly, so my users don't see the input is read only and never focus it!

                          – Hippyjim
                          Mar 3 '15 at 10:10




                          1




                          1





                          This works in Chrome v44.0.2403.125 m

                          – OutstandingBill
                          Aug 11 '15 at 3:26





                          This works in Chrome v44.0.2403.125 m

                          – OutstandingBill
                          Aug 11 '15 at 3:26













                          IMO Chrome is being WAY too helpful in autocomplete. I mean, ignoring autocomplete='off', wtf?! Thankfully, your solution worked. Still, WTF! Why wouldn't they trust the developer. If their form isn't auto-completed, it should be on the developer, not the browser to fix it.

                          – Funkodebat
                          Dec 6 '16 at 18:53





                          IMO Chrome is being WAY too helpful in autocomplete. I mean, ignoring autocomplete='off', wtf?! Thankfully, your solution worked. Still, WTF! Why wouldn't they trust the developer. If their form isn't auto-completed, it should be on the developer, not the browser to fix it.

                          – Funkodebat
                          Dec 6 '16 at 18:53











                          20














                          You can use autocomplete="new-password"



                          <input type="email" name="email">
                          <input type="password" name="password" autocomplete="new-password">


                          Works in:




                          • Chrome: 53, 54, 55

                          • Firefox: 48, 49, 50






                          share|improve this answer



















                          • 2





                            This is the most simplest solution and works as of today. None of the above solutions worked for me!

                            – learning_to_swim
                            Mar 23 '17 at 14:47






                          • 1





                            As today is 14 May 2018, this is the only working solution so far. Thanks!

                            – Adamy
                            May 14 '18 at 4:31











                          • this no longer works

                            – worc
                            Mar 25 at 23:05
















                          20














                          You can use autocomplete="new-password"



                          <input type="email" name="email">
                          <input type="password" name="password" autocomplete="new-password">


                          Works in:




                          • Chrome: 53, 54, 55

                          • Firefox: 48, 49, 50






                          share|improve this answer



















                          • 2





                            This is the most simplest solution and works as of today. None of the above solutions worked for me!

                            – learning_to_swim
                            Mar 23 '17 at 14:47






                          • 1





                            As today is 14 May 2018, this is the only working solution so far. Thanks!

                            – Adamy
                            May 14 '18 at 4:31











                          • this no longer works

                            – worc
                            Mar 25 at 23:05














                          20












                          20








                          20







                          You can use autocomplete="new-password"



                          <input type="email" name="email">
                          <input type="password" name="password" autocomplete="new-password">


                          Works in:




                          • Chrome: 53, 54, 55

                          • Firefox: 48, 49, 50






                          share|improve this answer













                          You can use autocomplete="new-password"



                          <input type="email" name="email">
                          <input type="password" name="password" autocomplete="new-password">


                          Works in:




                          • Chrome: 53, 54, 55

                          • Firefox: 48, 49, 50







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Feb 1 '17 at 10:19









                          SteffiSteffi

                          3,186155997




                          3,186155997








                          • 2





                            This is the most simplest solution and works as of today. None of the above solutions worked for me!

                            – learning_to_swim
                            Mar 23 '17 at 14:47






                          • 1





                            As today is 14 May 2018, this is the only working solution so far. Thanks!

                            – Adamy
                            May 14 '18 at 4:31











                          • this no longer works

                            – worc
                            Mar 25 at 23:05














                          • 2





                            This is the most simplest solution and works as of today. None of the above solutions worked for me!

                            – learning_to_swim
                            Mar 23 '17 at 14:47






                          • 1





                            As today is 14 May 2018, this is the only working solution so far. Thanks!

                            – Adamy
                            May 14 '18 at 4:31











                          • this no longer works

                            – worc
                            Mar 25 at 23:05








                          2




                          2





                          This is the most simplest solution and works as of today. None of the above solutions worked for me!

                          – learning_to_swim
                          Mar 23 '17 at 14:47





                          This is the most simplest solution and works as of today. None of the above solutions worked for me!

                          – learning_to_swim
                          Mar 23 '17 at 14:47




                          1




                          1





                          As today is 14 May 2018, this is the only working solution so far. Thanks!

                          – Adamy
                          May 14 '18 at 4:31





                          As today is 14 May 2018, this is the only working solution so far. Thanks!

                          – Adamy
                          May 14 '18 at 4:31













                          this no longer works

                          – worc
                          Mar 25 at 23:05





                          this no longer works

                          – worc
                          Mar 25 at 23:05











                          8














                          to anyone looking for a solution to this, I finally figure it out.



                          Chrome only obey's the autocomplete="off" if the page is a HTML5 page (I was using XHTML).



                          I converted my page to HTML5 and the problem went away (facepalm).






                          share|improve this answer



















                          • 6





                            My page is HTML5 and autocomplete="off" on an <input> element wasn't working. I had to turn off autocomplete for the entire form (<form autocomplete="off">) to finally get Chrome to stop autocompleting, since I'd rather not use a JavaScript solution.

                            – Gavin
                            Aug 15 '13 at 1:05








                          • 31





                            I've html5 page and it still ignores autocomplete="off" on both fields and form.

                            – Ashit Vora
                            Jun 25 '14 at 11:48
















                          8














                          to anyone looking for a solution to this, I finally figure it out.



                          Chrome only obey's the autocomplete="off" if the page is a HTML5 page (I was using XHTML).



                          I converted my page to HTML5 and the problem went away (facepalm).






                          share|improve this answer



















                          • 6





                            My page is HTML5 and autocomplete="off" on an <input> element wasn't working. I had to turn off autocomplete for the entire form (<form autocomplete="off">) to finally get Chrome to stop autocompleting, since I'd rather not use a JavaScript solution.

                            – Gavin
                            Aug 15 '13 at 1:05








                          • 31





                            I've html5 page and it still ignores autocomplete="off" on both fields and form.

                            – Ashit Vora
                            Jun 25 '14 at 11:48














                          8












                          8








                          8







                          to anyone looking for a solution to this, I finally figure it out.



                          Chrome only obey's the autocomplete="off" if the page is a HTML5 page (I was using XHTML).



                          I converted my page to HTML5 and the problem went away (facepalm).






                          share|improve this answer













                          to anyone looking for a solution to this, I finally figure it out.



                          Chrome only obey's the autocomplete="off" if the page is a HTML5 page (I was using XHTML).



                          I converted my page to HTML5 and the problem went away (facepalm).







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 16 '13 at 18:59









                          Mr FettMr Fett

                          2,17831518




                          2,17831518








                          • 6





                            My page is HTML5 and autocomplete="off" on an <input> element wasn't working. I had to turn off autocomplete for the entire form (<form autocomplete="off">) to finally get Chrome to stop autocompleting, since I'd rather not use a JavaScript solution.

                            – Gavin
                            Aug 15 '13 at 1:05








                          • 31





                            I've html5 page and it still ignores autocomplete="off" on both fields and form.

                            – Ashit Vora
                            Jun 25 '14 at 11:48














                          • 6





                            My page is HTML5 and autocomplete="off" on an <input> element wasn't working. I had to turn off autocomplete for the entire form (<form autocomplete="off">) to finally get Chrome to stop autocompleting, since I'd rather not use a JavaScript solution.

                            – Gavin
                            Aug 15 '13 at 1:05








                          • 31





                            I've html5 page and it still ignores autocomplete="off" on both fields and form.

                            – Ashit Vora
                            Jun 25 '14 at 11:48








                          6




                          6





                          My page is HTML5 and autocomplete="off" on an <input> element wasn't working. I had to turn off autocomplete for the entire form (<form autocomplete="off">) to finally get Chrome to stop autocompleting, since I'd rather not use a JavaScript solution.

                          – Gavin
                          Aug 15 '13 at 1:05







                          My page is HTML5 and autocomplete="off" on an <input> element wasn't working. I had to turn off autocomplete for the entire form (<form autocomplete="off">) to finally get Chrome to stop autocompleting, since I'd rather not use a JavaScript solution.

                          – Gavin
                          Aug 15 '13 at 1:05






                          31




                          31





                          I've html5 page and it still ignores autocomplete="off" on both fields and form.

                          – Ashit Vora
                          Jun 25 '14 at 11:48





                          I've html5 page and it still ignores autocomplete="off" on both fields and form.

                          – Ashit Vora
                          Jun 25 '14 at 11:48











                          8














                          Seen chrome ignore the autocomplete="off", I solve it with a stupid way which is using "fake input" to cheat chrome to fill it up instead of filling the "real" one.



                          Example:



                          <input type="text" name="username" style="display:none" value="fake input" /> 
                          <input type="text" name="username" value="real input"/>


                          Chrome will fill up the "fake input", and when submit, server will take the "real input" value.






                          share|improve this answer




























                            8














                            Seen chrome ignore the autocomplete="off", I solve it with a stupid way which is using "fake input" to cheat chrome to fill it up instead of filling the "real" one.



                            Example:



                            <input type="text" name="username" style="display:none" value="fake input" /> 
                            <input type="text" name="username" value="real input"/>


                            Chrome will fill up the "fake input", and when submit, server will take the "real input" value.






                            share|improve this answer


























                              8












                              8








                              8







                              Seen chrome ignore the autocomplete="off", I solve it with a stupid way which is using "fake input" to cheat chrome to fill it up instead of filling the "real" one.



                              Example:



                              <input type="text" name="username" style="display:none" value="fake input" /> 
                              <input type="text" name="username" value="real input"/>


                              Chrome will fill up the "fake input", and when submit, server will take the "real input" value.






                              share|improve this answer













                              Seen chrome ignore the autocomplete="off", I solve it with a stupid way which is using "fake input" to cheat chrome to fill it up instead of filling the "real" one.



                              Example:



                              <input type="text" name="username" style="display:none" value="fake input" /> 
                              <input type="text" name="username" value="real input"/>


                              Chrome will fill up the "fake input", and when submit, server will take the "real input" value.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered May 5 '14 at 8:09









                              ChangChang

                              19915




                              19915























                                  8














                                  Autocomplete="Off" doesn't work anymore.



                                  Try using just a random string instead of "Off", for example Autocomplete="NoAutocomplete"



                                  I hope it helps.






                                  share|improve this answer


























                                  • You're welcome!

                                    – marco burrometo
                                    Mar 13 at 16:22
















                                  8














                                  Autocomplete="Off" doesn't work anymore.



                                  Try using just a random string instead of "Off", for example Autocomplete="NoAutocomplete"



                                  I hope it helps.






                                  share|improve this answer


























                                  • You're welcome!

                                    – marco burrometo
                                    Mar 13 at 16:22














                                  8












                                  8








                                  8







                                  Autocomplete="Off" doesn't work anymore.



                                  Try using just a random string instead of "Off", for example Autocomplete="NoAutocomplete"



                                  I hope it helps.






                                  share|improve this answer















                                  Autocomplete="Off" doesn't work anymore.



                                  Try using just a random string instead of "Off", for example Autocomplete="NoAutocomplete"



                                  I hope it helps.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Feb 2 at 21:04









                                  Eduardo Cuomo

                                  10k16459




                                  10k16459










                                  answered Jan 7 at 10:19









                                  marco burrometomarco burrometo

                                  359618




                                  359618













                                  • You're welcome!

                                    – marco burrometo
                                    Mar 13 at 16:22



















                                  • You're welcome!

                                    – marco burrometo
                                    Mar 13 at 16:22

















                                  You're welcome!

                                  – marco burrometo
                                  Mar 13 at 16:22





                                  You're welcome!

                                  – marco burrometo
                                  Mar 13 at 16:22











                                  7














                                  I am posting this answer to bring an updated solution to this problem.
                                  I am currently using Chrome 49 and no given answer work for this one.
                                  I am also looking for a solution working with other browsers and previous versions.



                                  Put this code on the beginning of your form



                                  <div style="display: none;">
                                  <input type="text" autocomplete="new-password">
                                  <input type="password" autocomplete="new-password">
                                  </div>


                                  Then, for your real password field, use



                                  <input type="password" name="password" autocomplete="new-password">


                                  Comment this answer if this is no longer working or if you get an issue with another browser or version.



                                  Approved on:




                                  • Chrome : 49

                                  • Firefox : 44, 45

                                  • Edge : 25

                                  • Internet Explorer : 11






                                  share|improve this answer





















                                  • 1





                                    Unfortunately, Chrome version 49.0.2623.87 and it does not work for TextBox, I still see autocomplete poping up.

                                    – eYe
                                    Mar 31 '16 at 14:39


















                                  7














                                  I am posting this answer to bring an updated solution to this problem.
                                  I am currently using Chrome 49 and no given answer work for this one.
                                  I am also looking for a solution working with other browsers and previous versions.



                                  Put this code on the beginning of your form



                                  <div style="display: none;">
                                  <input type="text" autocomplete="new-password">
                                  <input type="password" autocomplete="new-password">
                                  </div>


                                  Then, for your real password field, use



                                  <input type="password" name="password" autocomplete="new-password">


                                  Comment this answer if this is no longer working or if you get an issue with another browser or version.



                                  Approved on:




                                  • Chrome : 49

                                  • Firefox : 44, 45

                                  • Edge : 25

                                  • Internet Explorer : 11






                                  share|improve this answer





















                                  • 1





                                    Unfortunately, Chrome version 49.0.2623.87 and it does not work for TextBox, I still see autocomplete poping up.

                                    – eYe
                                    Mar 31 '16 at 14:39
















                                  7












                                  7








                                  7







                                  I am posting this answer to bring an updated solution to this problem.
                                  I am currently using Chrome 49 and no given answer work for this one.
                                  I am also looking for a solution working with other browsers and previous versions.



                                  Put this code on the beginning of your form



                                  <div style="display: none;">
                                  <input type="text" autocomplete="new-password">
                                  <input type="password" autocomplete="new-password">
                                  </div>


                                  Then, for your real password field, use



                                  <input type="password" name="password" autocomplete="new-password">


                                  Comment this answer if this is no longer working or if you get an issue with another browser or version.



                                  Approved on:




                                  • Chrome : 49

                                  • Firefox : 44, 45

                                  • Edge : 25

                                  • Internet Explorer : 11






                                  share|improve this answer















                                  I am posting this answer to bring an updated solution to this problem.
                                  I am currently using Chrome 49 and no given answer work for this one.
                                  I am also looking for a solution working with other browsers and previous versions.



                                  Put this code on the beginning of your form



                                  <div style="display: none;">
                                  <input type="text" autocomplete="new-password">
                                  <input type="password" autocomplete="new-password">
                                  </div>


                                  Then, for your real password field, use



                                  <input type="password" name="password" autocomplete="new-password">


                                  Comment this answer if this is no longer working or if you get an issue with another browser or version.



                                  Approved on:




                                  • Chrome : 49

                                  • Firefox : 44, 45

                                  • Edge : 25

                                  • Internet Explorer : 11







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Mar 10 '16 at 19:31

























                                  answered Mar 10 '16 at 19:25









                                  LoenixLoenix

                                  788514




                                  788514








                                  • 1





                                    Unfortunately, Chrome version 49.0.2623.87 and it does not work for TextBox, I still see autocomplete poping up.

                                    – eYe
                                    Mar 31 '16 at 14:39
















                                  • 1





                                    Unfortunately, Chrome version 49.0.2623.87 and it does not work for TextBox, I still see autocomplete poping up.

                                    – eYe
                                    Mar 31 '16 at 14:39










                                  1




                                  1





                                  Unfortunately, Chrome version 49.0.2623.87 and it does not work for TextBox, I still see autocomplete poping up.

                                  – eYe
                                  Mar 31 '16 at 14:39







                                  Unfortunately, Chrome version 49.0.2623.87 and it does not work for TextBox, I still see autocomplete poping up.

                                  – eYe
                                  Mar 31 '16 at 14:39













                                  6














                                  Up until just this last week, the two solutions below appeared to work for Chrome, IE and Firefox. But with the release of Chrome version 48 (and still in 49), they no longer work:




                                  1. The following at the top of the form:


                                  <input style="display:none" type="text" name="fakeUsername"/>
                                  <input style="display:none" type="password" name="fakePassword"/>




                                  1. The following in the password input element:



                                    autocomplete="off"




                                  So to quickly fix this, at first I tried to use a major hack of initially setting the password input element to disabled and then used a setTimeout in the document ready function to enable it again.



                                  setTimeout(function(){$('#PasswordData').prop('disabled', false);}, 50);


                                  But this seemed so crazy and I did some more searching and found @tibalts answer in Disabling Chrome Autofill. His answer is to use autocomplete="new-password" in the passwords input and this appears to work on all browsers (I have kept my fix number 1 above at this stage).



                                  Here is the link in the Google Chrome developer discussion:
                                  https://code.google.com/p/chromium/issues/detail?id=370363#c7






                                  share|improve this answer


























                                  • autocomplete="new-password" worked on 49.0.2623.87

                                    – Jorge Sampayo
                                    Mar 10 '16 at 17:40











                                  • @JorgeSampayo Only works on password inputs but not on text inputs.

                                    – eYe
                                    Mar 31 '16 at 15:52











                                  • autocomplete="new-password" does not seem to work in FF 50 or IE 11

                                    – Andreas
                                    Dec 9 '16 at 12:27
















                                  6














                                  Up until just this last week, the two solutions below appeared to work for Chrome, IE and Firefox. But with the release of Chrome version 48 (and still in 49), they no longer work:




                                  1. The following at the top of the form:


                                  <input style="display:none" type="text" name="fakeUsername"/>
                                  <input style="display:none" type="password" name="fakePassword"/>




                                  1. The following in the password input element:



                                    autocomplete="off"




                                  So to quickly fix this, at first I tried to use a major hack of initially setting the password input element to disabled and then used a setTimeout in the document ready function to enable it again.



                                  setTimeout(function(){$('#PasswordData').prop('disabled', false);}, 50);


                                  But this seemed so crazy and I did some more searching and found @tibalts answer in Disabling Chrome Autofill. His answer is to use autocomplete="new-password" in the passwords input and this appears to work on all browsers (I have kept my fix number 1 above at this stage).



                                  Here is the link in the Google Chrome developer discussion:
                                  https://code.google.com/p/chromium/issues/detail?id=370363#c7






                                  share|improve this answer


























                                  • autocomplete="new-password" worked on 49.0.2623.87

                                    – Jorge Sampayo
                                    Mar 10 '16 at 17:40











                                  • @JorgeSampayo Only works on password inputs but not on text inputs.

                                    – eYe
                                    Mar 31 '16 at 15:52











                                  • autocomplete="new-password" does not seem to work in FF 50 or IE 11

                                    – Andreas
                                    Dec 9 '16 at 12:27














                                  6












                                  6








                                  6







                                  Up until just this last week, the two solutions below appeared to work for Chrome, IE and Firefox. But with the release of Chrome version 48 (and still in 49), they no longer work:




                                  1. The following at the top of the form:


                                  <input style="display:none" type="text" name="fakeUsername"/>
                                  <input style="display:none" type="password" name="fakePassword"/>




                                  1. The following in the password input element:



                                    autocomplete="off"




                                  So to quickly fix this, at first I tried to use a major hack of initially setting the password input element to disabled and then used a setTimeout in the document ready function to enable it again.



                                  setTimeout(function(){$('#PasswordData').prop('disabled', false);}, 50);


                                  But this seemed so crazy and I did some more searching and found @tibalts answer in Disabling Chrome Autofill. His answer is to use autocomplete="new-password" in the passwords input and this appears to work on all browsers (I have kept my fix number 1 above at this stage).



                                  Here is the link in the Google Chrome developer discussion:
                                  https://code.google.com/p/chromium/issues/detail?id=370363#c7






                                  share|improve this answer















                                  Up until just this last week, the two solutions below appeared to work for Chrome, IE and Firefox. But with the release of Chrome version 48 (and still in 49), they no longer work:




                                  1. The following at the top of the form:


                                  <input style="display:none" type="text" name="fakeUsername"/>
                                  <input style="display:none" type="password" name="fakePassword"/>




                                  1. The following in the password input element:



                                    autocomplete="off"




                                  So to quickly fix this, at first I tried to use a major hack of initially setting the password input element to disabled and then used a setTimeout in the document ready function to enable it again.



                                  setTimeout(function(){$('#PasswordData').prop('disabled', false);}, 50);


                                  But this seemed so crazy and I did some more searching and found @tibalts answer in Disabling Chrome Autofill. His answer is to use autocomplete="new-password" in the passwords input and this appears to work on all browsers (I have kept my fix number 1 above at this stage).



                                  Here is the link in the Google Chrome developer discussion:
                                  https://code.google.com/p/chromium/issues/detail?id=370363#c7







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited May 23 '17 at 12:34









                                  Community

                                  11




                                  11










                                  answered Jan 29 '16 at 3:46









                                  prajnaprajna

                                  1,36611317




                                  1,36611317













                                  • autocomplete="new-password" worked on 49.0.2623.87

                                    – Jorge Sampayo
                                    Mar 10 '16 at 17:40











                                  • @JorgeSampayo Only works on password inputs but not on text inputs.

                                    – eYe
                                    Mar 31 '16 at 15:52











                                  • autocomplete="new-password" does not seem to work in FF 50 or IE 11

                                    – Andreas
                                    Dec 9 '16 at 12:27



















                                  • autocomplete="new-password" worked on 49.0.2623.87

                                    – Jorge Sampayo
                                    Mar 10 '16 at 17:40











                                  • @JorgeSampayo Only works on password inputs but not on text inputs.

                                    – eYe
                                    Mar 31 '16 at 15:52











                                  • autocomplete="new-password" does not seem to work in FF 50 or IE 11

                                    – Andreas
                                    Dec 9 '16 at 12:27

















                                  autocomplete="new-password" worked on 49.0.2623.87

                                  – Jorge Sampayo
                                  Mar 10 '16 at 17:40





                                  autocomplete="new-password" worked on 49.0.2623.87

                                  – Jorge Sampayo
                                  Mar 10 '16 at 17:40













                                  @JorgeSampayo Only works on password inputs but not on text inputs.

                                  – eYe
                                  Mar 31 '16 at 15:52





                                  @JorgeSampayo Only works on password inputs but not on text inputs.

                                  – eYe
                                  Mar 31 '16 at 15:52













                                  autocomplete="new-password" does not seem to work in FF 50 or IE 11

                                  – Andreas
                                  Dec 9 '16 at 12:27





                                  autocomplete="new-password" does not seem to work in FF 50 or IE 11

                                  – Andreas
                                  Dec 9 '16 at 12:27











                                  5














                                  Instead of autocomplete="off" use autocomplete="false" ;)



                                  from: https://stackoverflow.com/a/29582380/75799






                                  share|improve this answer





















                                  • 1





                                    Actually not working in Chrome 65

                                    – Guilherme IA
                                    Mar 15 '18 at 21:55
















                                  5














                                  Instead of autocomplete="off" use autocomplete="false" ;)



                                  from: https://stackoverflow.com/a/29582380/75799






                                  share|improve this answer





















                                  • 1





                                    Actually not working in Chrome 65

                                    – Guilherme IA
                                    Mar 15 '18 at 21:55














                                  5












                                  5








                                  5







                                  Instead of autocomplete="off" use autocomplete="false" ;)



                                  from: https://stackoverflow.com/a/29582380/75799






                                  share|improve this answer















                                  Instead of autocomplete="off" use autocomplete="false" ;)



                                  from: https://stackoverflow.com/a/29582380/75799







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited May 23 '17 at 12:18









                                  Community

                                  11




                                  11










                                  answered Oct 17 '15 at 0:43









                                  BasitBasit

                                  5,4752476130




                                  5,4752476130








                                  • 1





                                    Actually not working in Chrome 65

                                    – Guilherme IA
                                    Mar 15 '18 at 21:55














                                  • 1





                                    Actually not working in Chrome 65

                                    – Guilherme IA
                                    Mar 15 '18 at 21:55








                                  1




                                  1





                                  Actually not working in Chrome 65

                                  – Guilherme IA
                                  Mar 15 '18 at 21:55





                                  Actually not working in Chrome 65

                                  – Guilherme IA
                                  Mar 15 '18 at 21:55











                                  5














                                  autocomplete=off is largely ignored in modern browsers - primarily due to password managers etc.



                                  You can try adding this autocomplete="new-password" it's not fully supported by all browsers, but it works on some






                                  share|improve this answer




























                                    5














                                    autocomplete=off is largely ignored in modern browsers - primarily due to password managers etc.



                                    You can try adding this autocomplete="new-password" it's not fully supported by all browsers, but it works on some






                                    share|improve this answer


























                                      5












                                      5








                                      5







                                      autocomplete=off is largely ignored in modern browsers - primarily due to password managers etc.



                                      You can try adding this autocomplete="new-password" it's not fully supported by all browsers, but it works on some






                                      share|improve this answer













                                      autocomplete=off is largely ignored in modern browsers - primarily due to password managers etc.



                                      You can try adding this autocomplete="new-password" it's not fully supported by all browsers, but it works on some







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Oct 29 '17 at 7:02









                                      Mahdi AfzalMahdi Afzal

                                      13934




                                      13934























                                          4














                                          As of Chrome 42, none of the solutions/hacks in this thread (as of 2015-05-21T12:50:23+00:00) work for disabling autocomplete for an individual field or the entire form.



                                          EDIT: I've found that you actually only need to insert one dummy email field into your form (you can hide it with display: none) before the other fields to prevent autocompleting. I presume that chrome stores some sort of form signature with each autocompleted field and including another email field corrupts this signature and prevents autocompleting.



                                          <form action="/login" method="post">
                                          <input type="email" name="fake_email" style="display:none" aria-hidden="true">
                                          <input type="email" name="email">
                                          <input type="password" name="password">
                                          <input type="submit">
                                          </form>


                                          The good news is that since the "form signature" is corrupted by this, none of the fields are autocompleted, so no JS is needed to clear the fake fields before submission.



                                          Old Answer:



                                          The only thing I've found to be still viable is to insert two dummy fields of type email and password before the real fields. You can set them to display: none to hide them away (it isn't smart enough to ignore those fields):



                                          <form action="/login" method="post">
                                          <input type="email" name="fake_email" style="display:none" aria-hidden="true">
                                          <input type="password" name="fake_password" style="display:none" aria-hidden="true">
                                          <input type="email" name="email">
                                          <input type="password" name="password">
                                          <input type="submit">
                                          </form>


                                          Unfortunately, the fields must be within your form (otherwise both sets of inputs are autofilled). So, for the fake fields to be truly ignored you'll need some JS to run on form submit to clear them:



                                          form.addEventListener('submit', function() {
                                          form.elements['fake_email'].value = '';
                                          form.elements['fake_password'].value = '';
                                          });




                                          Notice from above that clearing the value with Javascript works to override the autocomplete. So if loosing the proper behavior with JS disabled is acceptable, you can simplify all of this with a JS autocomplete "polyfill" for Chrome:



                                          (function(document) {

                                          function polyfillAutocomplete(nodes) {

                                          for(var i = 0, length = nodes.length; i < length; i++) {

                                          if(nodes[i].getAttribute('autocomplete') === 'off') {

                                          nodes[i].value = '';
                                          }
                                          }
                                          }

                                          setTimeout(function() {

                                          polyfillAutocomplete(document.getElementsByTagName('input'));
                                          polyfillAutocomplete(document.getElementsByTagName('textarea'));

                                          }, 1);

                                          })(window.document);





                                          share|improve this answer
























                                          • All of these solutions require a form tag; but what if your form tag is part of your masterpage?

                                            – Jonathon Cowley-Thom
                                            Oct 12 '15 at 10:09











                                          • I don't know what you mean by masterpage, but regardless of the scope of the form, you should be able to disable autocomplete by including a dummy email before your real email field.

                                            – Bailey Parker
                                            Oct 18 '15 at 21:38
















                                          4














                                          As of Chrome 42, none of the solutions/hacks in this thread (as of 2015-05-21T12:50:23+00:00) work for disabling autocomplete for an individual field or the entire form.



                                          EDIT: I've found that you actually only need to insert one dummy email field into your form (you can hide it with display: none) before the other fields to prevent autocompleting. I presume that chrome stores some sort of form signature with each autocompleted field and including another email field corrupts this signature and prevents autocompleting.



                                          <form action="/login" method="post">
                                          <input type="email" name="fake_email" style="display:none" aria-hidden="true">
                                          <input type="email" name="email">
                                          <input type="password" name="password">
                                          <input type="submit">
                                          </form>


                                          The good news is that since the "form signature" is corrupted by this, none of the fields are autocompleted, so no JS is needed to clear the fake fields before submission.



                                          Old Answer:



                                          The only thing I've found to be still viable is to insert two dummy fields of type email and password before the real fields. You can set them to display: none to hide them away (it isn't smart enough to ignore those fields):



                                          <form action="/login" method="post">
                                          <input type="email" name="fake_email" style="display:none" aria-hidden="true">
                                          <input type="password" name="fake_password" style="display:none" aria-hidden="true">
                                          <input type="email" name="email">
                                          <input type="password" name="password">
                                          <input type="submit">
                                          </form>


                                          Unfortunately, the fields must be within your form (otherwise both sets of inputs are autofilled). So, for the fake fields to be truly ignored you'll need some JS to run on form submit to clear them:



                                          form.addEventListener('submit', function() {
                                          form.elements['fake_email'].value = '';
                                          form.elements['fake_password'].value = '';
                                          });




                                          Notice from above that clearing the value with Javascript works to override the autocomplete. So if loosing the proper behavior with JS disabled is acceptable, you can simplify all of this with a JS autocomplete "polyfill" for Chrome:



                                          (function(document) {

                                          function polyfillAutocomplete(nodes) {

                                          for(var i = 0, length = nodes.length; i < length; i++) {

                                          if(nodes[i].getAttribute('autocomplete') === 'off') {

                                          nodes[i].value = '';
                                          }
                                          }
                                          }

                                          setTimeout(function() {

                                          polyfillAutocomplete(document.getElementsByTagName('input'));
                                          polyfillAutocomplete(document.getElementsByTagName('textarea'));

                                          }, 1);

                                          })(window.document);





                                          share|improve this answer
























                                          • All of these solutions require a form tag; but what if your form tag is part of your masterpage?

                                            – Jonathon Cowley-Thom
                                            Oct 12 '15 at 10:09











                                          • I don't know what you mean by masterpage, but regardless of the scope of the form, you should be able to disable autocomplete by including a dummy email before your real email field.

                                            – Bailey Parker
                                            Oct 18 '15 at 21:38














                                          4












                                          4








                                          4







                                          As of Chrome 42, none of the solutions/hacks in this thread (as of 2015-05-21T12:50:23+00:00) work for disabling autocomplete for an individual field or the entire form.



                                          EDIT: I've found that you actually only need to insert one dummy email field into your form (you can hide it with display: none) before the other fields to prevent autocompleting. I presume that chrome stores some sort of form signature with each autocompleted field and including another email field corrupts this signature and prevents autocompleting.



                                          <form action="/login" method="post">
                                          <input type="email" name="fake_email" style="display:none" aria-hidden="true">
                                          <input type="email" name="email">
                                          <input type="password" name="password">
                                          <input type="submit">
                                          </form>


                                          The good news is that since the "form signature" is corrupted by this, none of the fields are autocompleted, so no JS is needed to clear the fake fields before submission.



                                          Old Answer:



                                          The only thing I've found to be still viable is to insert two dummy fields of type email and password before the real fields. You can set them to display: none to hide them away (it isn't smart enough to ignore those fields):



                                          <form action="/login" method="post">
                                          <input type="email" name="fake_email" style="display:none" aria-hidden="true">
                                          <input type="password" name="fake_password" style="display:none" aria-hidden="true">
                                          <input type="email" name="email">
                                          <input type="password" name="password">
                                          <input type="submit">
                                          </form>


                                          Unfortunately, the fields must be within your form (otherwise both sets of inputs are autofilled). So, for the fake fields to be truly ignored you'll need some JS to run on form submit to clear them:



                                          form.addEventListener('submit', function() {
                                          form.elements['fake_email'].value = '';
                                          form.elements['fake_password'].value = '';
                                          });




                                          Notice from above that clearing the value with Javascript works to override the autocomplete. So if loosing the proper behavior with JS disabled is acceptable, you can simplify all of this with a JS autocomplete "polyfill" for Chrome:



                                          (function(document) {

                                          function polyfillAutocomplete(nodes) {

                                          for(var i = 0, length = nodes.length; i < length; i++) {

                                          if(nodes[i].getAttribute('autocomplete') === 'off') {

                                          nodes[i].value = '';
                                          }
                                          }
                                          }

                                          setTimeout(function() {

                                          polyfillAutocomplete(document.getElementsByTagName('input'));
                                          polyfillAutocomplete(document.getElementsByTagName('textarea'));

                                          }, 1);

                                          })(window.document);





                                          share|improve this answer













                                          As of Chrome 42, none of the solutions/hacks in this thread (as of 2015-05-21T12:50:23+00:00) work for disabling autocomplete for an individual field or the entire form.



                                          EDIT: I've found that you actually only need to insert one dummy email field into your form (you can hide it with display: none) before the other fields to prevent autocompleting. I presume that chrome stores some sort of form signature with each autocompleted field and including another email field corrupts this signature and prevents autocompleting.



                                          <form action="/login" method="post">
                                          <input type="email" name="fake_email" style="display:none" aria-hidden="true">
                                          <input type="email" name="email">
                                          <input type="password" name="password">
                                          <input type="submit">
                                          </form>


                                          The good news is that since the "form signature" is corrupted by this, none of the fields are autocompleted, so no JS is needed to clear the fake fields before submission.



                                          Old Answer:



                                          The only thing I've found to be still viable is to insert two dummy fields of type email and password before the real fields. You can set them to display: none to hide them away (it isn't smart enough to ignore those fields):



                                          <form action="/login" method="post">
                                          <input type="email" name="fake_email" style="display:none" aria-hidden="true">
                                          <input type="password" name="fake_password" style="display:none" aria-hidden="true">
                                          <input type="email" name="email">
                                          <input type="password" name="password">
                                          <input type="submit">
                                          </form>


                                          Unfortunately, the fields must be within your form (otherwise both sets of inputs are autofilled). So, for the fake fields to be truly ignored you'll need some JS to run on form submit to clear them:



                                          form.addEventListener('submit', function() {
                                          form.elements['fake_email'].value = '';
                                          form.elements['fake_password'].value = '';
                                          });




                                          Notice from above that clearing the value with Javascript works to override the autocomplete. So if loosing the proper behavior with JS disabled is acceptable, you can simplify all of this with a JS autocomplete "polyfill" for Chrome:



                                          (function(document) {

                                          function polyfillAutocomplete(nodes) {

                                          for(var i = 0, length = nodes.length; i < length; i++) {

                                          if(nodes[i].getAttribute('autocomplete') === 'off') {

                                          nodes[i].value = '';
                                          }
                                          }
                                          }

                                          setTimeout(function() {

                                          polyfillAutocomplete(document.getElementsByTagName('input'));
                                          polyfillAutocomplete(document.getElementsByTagName('textarea'));

                                          }, 1);

                                          })(window.document);






                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered May 21 '15 at 13:03









                                          Bailey ParkerBailey Parker

                                          12.1k23871




                                          12.1k23871













                                          • All of these solutions require a form tag; but what if your form tag is part of your masterpage?

                                            – Jonathon Cowley-Thom
                                            Oct 12 '15 at 10:09











                                          • I don't know what you mean by masterpage, but regardless of the scope of the form, you should be able to disable autocomplete by including a dummy email before your real email field.

                                            – Bailey Parker
                                            Oct 18 '15 at 21:38



















                                          • All of these solutions require a form tag; but what if your form tag is part of your masterpage?

                                            – Jonathon Cowley-Thom
                                            Oct 12 '15 at 10:09











                                          • I don't know what you mean by masterpage, but regardless of the scope of the form, you should be able to disable autocomplete by including a dummy email before your real email field.

                                            – Bailey Parker
                                            Oct 18 '15 at 21:38

















                                          All of these solutions require a form tag; but what if your form tag is part of your masterpage?

                                          – Jonathon Cowley-Thom
                                          Oct 12 '15 at 10:09





                                          All of these solutions require a form tag; but what if your form tag is part of your masterpage?

                                          – Jonathon Cowley-Thom
                                          Oct 12 '15 at 10:09













                                          I don't know what you mean by masterpage, but regardless of the scope of the form, you should be able to disable autocomplete by including a dummy email before your real email field.

                                          – Bailey Parker
                                          Oct 18 '15 at 21:38





                                          I don't know what you mean by masterpage, but regardless of the scope of the form, you should be able to disable autocomplete by including a dummy email before your real email field.

                                          – Bailey Parker
                                          Oct 18 '15 at 21:38











                                          3














                                          After the chrome v. 34, setting autocomplete="off" at <form> tag doesn`t work



                                          I made the changes to avoid this annoying behavior:




                                          1. Remove the name and the id of the password input

                                          2. Put a class in the input (ex.: passwordInput )


                                          (So far, Chrome wont put the saved password on the input, but the form is now broken)



                                          Finally, to make the form work, put this code to run when the user click the submit button, or whenever you want to trigger the form submittion:



                                          var sI = $(".passwordInput")[0];
                                          $(sI).attr("id", "password");
                                          $(sI).attr("name", "password");


                                          In my case, I used to hav id="password" name="password" in the password input, so I put them back before trigger the submition.






                                          share|improve this answer
























                                          • Yes, and this google's decision is really strange - theregister.co.uk/2014/04/09/…

                                            – cryss
                                            May 5 '14 at 9:33











                                          • This works, but it's no fun trying to do this when you've got a self-registration form with 20-odd fields on it, all of which need to be autocomplete="off".

                                            – Jonathon Cowley-Thom
                                            Oct 12 '15 at 10:14
















                                          3














                                          After the chrome v. 34, setting autocomplete="off" at <form> tag doesn`t work



                                          I made the changes to avoid this annoying behavior:




                                          1. Remove the name and the id of the password input

                                          2. Put a class in the input (ex.: passwordInput )


                                          (So far, Chrome wont put the saved password on the input, but the form is now broken)



                                          Finally, to make the form work, put this code to run when the user click the submit button, or whenever you want to trigger the form submittion:



                                          var sI = $(".passwordInput")[0];
                                          $(sI).attr("id", "password");
                                          $(sI).attr("name", "password");


                                          In my case, I used to hav id="password" name="password" in the password input, so I put them back before trigger the submition.






                                          share|improve this answer
























                                          • Yes, and this google's decision is really strange - theregister.co.uk/2014/04/09/…

                                            – cryss
                                            May 5 '14 at 9:33











                                          • This works, but it's no fun trying to do this when you've got a self-registration form with 20-odd fields on it, all of which need to be autocomplete="off".

                                            – Jonathon Cowley-Thom
                                            Oct 12 '15 at 10:14














                                          3












                                          3








                                          3







                                          After the chrome v. 34, setting autocomplete="off" at <form> tag doesn`t work



                                          I made the changes to avoid this annoying behavior:




                                          1. Remove the name and the id of the password input

                                          2. Put a class in the input (ex.: passwordInput )


                                          (So far, Chrome wont put the saved password on the input, but the form is now broken)



                                          Finally, to make the form work, put this code to run when the user click the submit button, or whenever you want to trigger the form submittion:



                                          var sI = $(".passwordInput")[0];
                                          $(sI).attr("id", "password");
                                          $(sI).attr("name", "password");


                                          In my case, I used to hav id="password" name="password" in the password input, so I put them back before trigger the submition.






                                          share|improve this answer













                                          After the chrome v. 34, setting autocomplete="off" at <form> tag doesn`t work



                                          I made the changes to avoid this annoying behavior:




                                          1. Remove the name and the id of the password input

                                          2. Put a class in the input (ex.: passwordInput )


                                          (So far, Chrome wont put the saved password on the input, but the form is now broken)



                                          Finally, to make the form work, put this code to run when the user click the submit button, or whenever you want to trigger the form submittion:



                                          var sI = $(".passwordInput")[0];
                                          $(sI).attr("id", "password");
                                          $(sI).attr("name", "password");


                                          In my case, I used to hav id="password" name="password" in the password input, so I put them back before trigger the submition.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Apr 23 '14 at 16:46









                                          Renato LochettiRenato Lochetti

                                          3,52222444




                                          3,52222444













                                          • Yes, and this google's decision is really strange - theregister.co.uk/2014/04/09/…

                                            – cryss
                                            May 5 '14 at 9:33











                                          • This works, but it's no fun trying to do this when you've got a self-registration form with 20-odd fields on it, all of which need to be autocomplete="off".

                                            – Jonathon Cowley-Thom
                                            Oct 12 '15 at 10:14



















                                          • Yes, and this google's decision is really strange - theregister.co.uk/2014/04/09/…

                                            – cryss
                                            May 5 '14 at 9:33











                                          • This works, but it's no fun trying to do this when you've got a self-registration form with 20-odd fields on it, all of which need to be autocomplete="off".

                                            – Jonathon Cowley-Thom
                                            Oct 12 '15 at 10:14

















                                          Yes, and this google's decision is really strange - theregister.co.uk/2014/04/09/…

                                          – cryss
                                          May 5 '14 at 9:33





                                          Yes, and this google's decision is really strange - theregister.co.uk/2014/04/09/…

                                          – cryss
                                          May 5 '14 at 9:33













                                          This works, but it's no fun trying to do this when you've got a self-registration form with 20-odd fields on it, all of which need to be autocomplete="off".

                                          – Jonathon Cowley-Thom
                                          Oct 12 '15 at 10:14





                                          This works, but it's no fun trying to do this when you've got a self-registration form with 20-odd fields on it, all of which need to be autocomplete="off".

                                          – Jonathon Cowley-Thom
                                          Oct 12 '15 at 10:14











                                          3














                                          After having tried all solutions, Here is what seems to be working for chrome version:45, with form having password field :



                                           jQuery('document').ready(function(){
                                          //For disabling Chrome Autocomplete
                                          jQuery( ":text" ).attr('autocomplete','pre'+Math.random(0,100000000));
                                          });





                                          share|improve this answer



















                                          • 1





                                            what does 'pre'+Math.random(0,100000000) do? Can you please give more detail on your answer.

                                            – Serge Eremeev
                                            Jun 20 '16 at 9:58
















                                          3














                                          After having tried all solutions, Here is what seems to be working for chrome version:45, with form having password field :



                                           jQuery('document').ready(function(){
                                          //For disabling Chrome Autocomplete
                                          jQuery( ":text" ).attr('autocomplete','pre'+Math.random(0,100000000));
                                          });





                                          share|improve this answer



















                                          • 1





                                            what does 'pre'+Math.random(0,100000000) do? Can you please give more detail on your answer.

                                            – Serge Eremeev
                                            Jun 20 '16 at 9:58














                                          3












                                          3








                                          3







                                          After having tried all solutions, Here is what seems to be working for chrome version:45, with form having password field :



                                           jQuery('document').ready(function(){
                                          //For disabling Chrome Autocomplete
                                          jQuery( ":text" ).attr('autocomplete','pre'+Math.random(0,100000000));
                                          });





                                          share|improve this answer













                                          After having tried all solutions, Here is what seems to be working for chrome version:45, with form having password field :



                                           jQuery('document').ready(function(){
                                          //For disabling Chrome Autocomplete
                                          jQuery( ":text" ).attr('autocomplete','pre'+Math.random(0,100000000));
                                          });






                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Oct 5 '15 at 12:43









                                          anshumananshuman

                                          3,08011413




                                          3,08011413








                                          • 1





                                            what does 'pre'+Math.random(0,100000000) do? Can you please give more detail on your answer.

                                            – Serge Eremeev
                                            Jun 20 '16 at 9:58














                                          • 1





                                            what does 'pre'+Math.random(0,100000000) do? Can you please give more detail on your answer.

                                            – Serge Eremeev
                                            Jun 20 '16 at 9:58








                                          1




                                          1





                                          what does 'pre'+Math.random(0,100000000) do? Can you please give more detail on your answer.

                                          – Serge Eremeev
                                          Jun 20 '16 at 9:58





                                          what does 'pre'+Math.random(0,100000000) do? Can you please give more detail on your answer.

                                          – Serge Eremeev
                                          Jun 20 '16 at 9:58











                                          3














                                          Change input type attribute to type="search".



                                          Google doesn't apply auto-fill to inputs with a type of search.






                                          share|improve this answer
























                                          • I am not down voting this solution but need to mention that I have just tried using search as type and it still gets auto-completed...

                                            – eYe
                                            Mar 31 '16 at 14:53











                                          • @eYe Hmm, could be they patched this one up too. Thanks for letting me know.

                                            – Matas Vaitkevicius
                                            Mar 31 '16 at 14:59













                                          • I'll downvote: tested on chrome 60: this doesn't prevent autocomplete..

                                            – boly38
                                            Sep 21 '17 at 10:10











                                          • It works on Chrome V64.0.3282.167

                                            – Jaggana
                                            Feb 27 '18 at 12:39
















                                          3














                                          Change input type attribute to type="search".



                                          Google doesn't apply auto-fill to inputs with a type of search.






                                          share|improve this answer
























                                          • I am not down voting this solution but need to mention that I have just tried using search as type and it still gets auto-completed...

                                            – eYe
                                            Mar 31 '16 at 14:53











                                          • @eYe Hmm, could be they patched this one up too. Thanks for letting me know.

                                            – Matas Vaitkevicius
                                            Mar 31 '16 at 14:59













                                          • I'll downvote: tested on chrome 60: this doesn't prevent autocomplete..

                                            – boly38
                                            Sep 21 '17 at 10:10











                                          • It works on Chrome V64.0.3282.167

                                            – Jaggana
                                            Feb 27 '18 at 12:39














                                          3












                                          3








                                          3







                                          Change input type attribute to type="search".



                                          Google doesn't apply auto-fill to inputs with a type of search.






                                          share|improve this answer













                                          Change input type attribute to type="search".



                                          Google doesn't apply auto-fill to inputs with a type of search.







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Oct 28 '15 at 16:29









                                          Matas VaitkeviciusMatas Vaitkevicius

                                          34.3k16168176




                                          34.3k16168176













                                          • I am not down voting this solution but need to mention that I have just tried using search as type and it still gets auto-completed...

                                            – eYe
                                            Mar 31 '16 at 14:53











                                          • @eYe Hmm, could be they patched this one up too. Thanks for letting me know.

                                            – Matas Vaitkevicius
                                            Mar 31 '16 at 14:59













                                          • I'll downvote: tested on chrome 60: this doesn't prevent autocomplete..

                                            – boly38
                                            Sep 21 '17 at 10:10











                                          • It works on Chrome V64.0.3282.167

                                            – Jaggana
                                            Feb 27 '18 at 12:39



















                                          • I am not down voting this solution but need to mention that I have just tried using search as type and it still gets auto-completed...

                                            – eYe
                                            Mar 31 '16 at 14:53











                                          • @eYe Hmm, could be they patched this one up too. Thanks for letting me know.

                                            – Matas Vaitkevicius
                                            Mar 31 '16 at 14:59













                                          • I'll downvote: tested on chrome 60: this doesn't prevent autocomplete..

                                            – boly38
                                            Sep 21 '17 at 10:10











                                          • It works on Chrome V64.0.3282.167

                                            – Jaggana
                                            Feb 27 '18 at 12:39

















                                          I am not down voting this solution but need to mention that I have just tried using search as type and it still gets auto-completed...

                                          – eYe
                                          Mar 31 '16 at 14:53





                                          I am not down voting this solution but need to mention that I have just tried using search as type and it still gets auto-completed...

                                          – eYe
                                          Mar 31 '16 at 14:53













                                          @eYe Hmm, could be they patched this one up too. Thanks for letting me know.

                                          – Matas Vaitkevicius
                                          Mar 31 '16 at 14:59







                                          @eYe Hmm, could be they patched this one up too. Thanks for letting me know.

                                          – Matas Vaitkevicius
                                          Mar 31 '16 at 14:59















                                          I'll downvote: tested on chrome 60: this doesn't prevent autocomplete..

                                          – boly38
                                          Sep 21 '17 at 10:10





                                          I'll downvote: tested on chrome 60: this doesn't prevent autocomplete..

                                          – boly38
                                          Sep 21 '17 at 10:10













                                          It works on Chrome V64.0.3282.167

                                          – Jaggana
                                          Feb 27 '18 at 12:39





                                          It works on Chrome V64.0.3282.167

                                          – Jaggana
                                          Feb 27 '18 at 12:39











                                          3














                                          I just updated to Chrome 49 and Diogo Cid's solution doesn't work anymore.



                                          I made a different workaround hiding and removing the fields at run-time after the page is loaded.



                                          Chrome now ignores the original workaround applying the credentials to the first displayed type="password" field and its previous type="text" field, so I have hidden both fields using CSS visibility: hidden;



                                          <!-- HTML -->
                                          <form>
                                          <!-- Fake fields -->
                                          <input class="chromeHack-autocomplete">
                                          <input type="password" class="chromeHack-autocomplete">

                                          <input type="text" placeholder="e-mail" autocomplete="off" />
                                          <input type="password" placeholder="Password" autocomplete="off" />
                                          </form>

                                          <!-- CSS -->
                                          .chromeHack-autocomplete {
                                          height: 0px !important;
                                          width: 0px !important;
                                          opacity: 0 !important;
                                          padding: 0 !important; margin: 0 !important;
                                          }

                                          <!--JavaScript (jQuery) -->
                                          jQuery(window).load(function() {
                                          $(".chromeHack-autocomplete").delay(100).hide(0, function() {
                                          $(this).remove();
                                          });
                                          });


                                          I know that it may seem not very elegant but it works.






                                          share|improve this answer






























                                            3














                                            I just updated to Chrome 49 and Diogo Cid's solution doesn't work anymore.



                                            I made a different workaround hiding and removing the fields at run-time after the page is loaded.



                                            Chrome now ignores the original workaround applying the credentials to the first displayed type="password" field and its previous type="text" field, so I have hidden both fields using CSS visibility: hidden;



                                            <!-- HTML -->
                                            <form>
                                            <!-- Fake fields -->
                                            <input class="chromeHack-autocomplete">
                                            <input type="password" class="chromeHack-autocomplete">

                                            <input type="text" placeholder="e-mail" autocomplete="off" />
                                            <input type="password" placeholder="Password" autocomplete="off" />
                                            </form>

                                            <!-- CSS -->
                                            .chromeHack-autocomplete {
                                            height: 0px !important;
                                            width: 0px !important;
                                            opacity: 0 !important;
                                            padding: 0 !important; margin: 0 !important;
                                            }

                                            <!--JavaScript (jQuery) -->
                                            jQuery(window).load(function() {
                                            $(".chromeHack-autocomplete").delay(100).hide(0, function() {
                                            $(this).remove();
                                            });
                                            });


                                            I know that it may seem not very elegant but it works.






                                            share|improve this answer




























                                              3












                                              3








                                              3







                                              I just updated to Chrome 49 and Diogo Cid's solution doesn't work anymore.



                                              I made a different workaround hiding and removing the fields at run-time after the page is loaded.



                                              Chrome now ignores the original workaround applying the credentials to the first displayed type="password" field and its previous type="text" field, so I have hidden both fields using CSS visibility: hidden;



                                              <!-- HTML -->
                                              <form>
                                              <!-- Fake fields -->
                                              <input class="chromeHack-autocomplete">
                                              <input type="password" class="chromeHack-autocomplete">

                                              <input type="text" placeholder="e-mail" autocomplete="off" />
                                              <input type="password" placeholder="Password" autocomplete="off" />
                                              </form>

                                              <!-- CSS -->
                                              .chromeHack-autocomplete {
                                              height: 0px !important;
                                              width: 0px !important;
                                              opacity: 0 !important;
                                              padding: 0 !important; margin: 0 !important;
                                              }

                                              <!--JavaScript (jQuery) -->
                                              jQuery(window).load(function() {
                                              $(".chromeHack-autocomplete").delay(100).hide(0, function() {
                                              $(this).remove();
                                              });
                                              });


                                              I know that it may seem not very elegant but it works.






                                              share|improve this answer















                                              I just updated to Chrome 49 and Diogo Cid's solution doesn't work anymore.



                                              I made a different workaround hiding and removing the fields at run-time after the page is loaded.



                                              Chrome now ignores the original workaround applying the credentials to the first displayed type="password" field and its previous type="text" field, so I have hidden both fields using CSS visibility: hidden;



                                              <!-- HTML -->
                                              <form>
                                              <!-- Fake fields -->
                                              <input class="chromeHack-autocomplete">
                                              <input type="password" class="chromeHack-autocomplete">

                                              <input type="text" placeholder="e-mail" autocomplete="off" />
                                              <input type="password" placeholder="Password" autocomplete="off" />
                                              </form>

                                              <!-- CSS -->
                                              .chromeHack-autocomplete {
                                              height: 0px !important;
                                              width: 0px !important;
                                              opacity: 0 !important;
                                              padding: 0 !important; margin: 0 !important;
                                              }

                                              <!--JavaScript (jQuery) -->
                                              jQuery(window).load(function() {
                                              $(".chromeHack-autocomplete").delay(100).hide(0, function() {
                                              $(this).remove();
                                              });
                                              });


                                              I know that it may seem not very elegant but it works.







                                              share|improve this answer














                                              share|improve this answer



                                              share|improve this answer








                                              edited May 23 '17 at 11:47









                                              Community

                                              11




                                              11










                                              answered Mar 14 '16 at 11:42









                                              Cliff BurtonCliff Burton

                                              1,52942433




                                              1,52942433























                                                  3














                                                  In Chrome 48+ use this solution:





                                                  1. Put fake fields before real fields:



                                                    <form autocomplete="off">
                                                    <input name="fake_email" class="visually-hidden" type="text">
                                                    <input name="fake_password" class="visually-hidden" type="password">

                                                    <input autocomplete="off" name="email" type="text">
                                                    <input autocomplete="off" name="password" type="password">
                                                    </form>



                                                  2. Hide fake fields:



                                                    .visually-hidden {
                                                    margin: -1px;
                                                    padding: 0;
                                                    width: 1px;
                                                    height: 1px;
                                                    overflow: hidden;
                                                    clip: rect(0 0 0 0);
                                                    clip: rect(0, 0, 0, 0);
                                                    position: absolute;
                                                    }


                                                  3. You did it!



                                                  Also this will work for older versions.






                                                  share|improve this answer


























                                                  • This works for me with Chrome 52...

                                                    – Daniel Bleisteiner
                                                    Aug 1 '16 at 11:38











                                                  • Anyone confirm if this is working for version 60? Tried implementing and doesn't appear to work except for incognito :(

                                                    – Mike Purcell
                                                    Aug 28 '17 at 18:57











                                                  • @MikePurcell It works for me. I have OS X 10.12.4 and Chrome 60.0.3112.101. See screenshots what you actually should have: dropbox.com/s/11btbxl469hagbt/… and dropbox.com/s/73nom28iewd8z8m/…

                                                    – yivo
                                                    Aug 29 '17 at 9:32













                                                  • @yivo Looks like the only diff between urs and og answer is the !important tags, so I added them, still not working. dropbox.com/s/24yaz6ut7ygkoql/…

                                                    – Mike Purcell
                                                    Aug 29 '17 at 13:45











                                                  • @MikePurcell You don't have autocomplete="off" on the form tag. Also try to put fake inputs immediately after form tag.

                                                    – yivo
                                                    Aug 30 '17 at 8:17
















                                                  3














                                                  In Chrome 48+ use this solution:





                                                  1. Put fake fields before real fields:



                                                    <form autocomplete="off">
                                                    <input name="fake_email" class="visually-hidden" type="text">
                                                    <input name="fake_password" class="visually-hidden" type="password">

                                                    <input autocomplete="off" name="email" type="text">
                                                    <input autocomplete="off" name="password" type="password">
                                                    </form>



                                                  2. Hide fake fields:



                                                    .visually-hidden {
                                                    margin: -1px;
                                                    padding: 0;
                                                    width: 1px;
                                                    height: 1px;
                                                    overflow: hidden;
                                                    clip: rect(0 0 0 0);
                                                    clip: rect(0, 0, 0, 0);
                                                    position: absolute;
                                                    }


                                                  3. You did it!



                                                  Also this will work for older versions.






                                                  share|improve this answer


























                                                  • This works for me with Chrome 52...

                                                    – Daniel Bleisteiner
                                                    Aug 1 '16 at 11:38











                                                  • Anyone confirm if this is working for version 60? Tried implementing and doesn't appear to work except for incognito :(

                                                    – Mike Purcell
                                                    Aug 28 '17 at 18:57











                                                  • @MikePurcell It works for me. I have OS X 10.12.4 and Chrome 60.0.3112.101. See screenshots what you actually should have: dropbox.com/s/11btbxl469hagbt/… and dropbox.com/s/73nom28iewd8z8m/…

                                                    – yivo
                                                    Aug 29 '17 at 9:32













                                                  • @yivo Looks like the only diff between urs and og answer is the !important tags, so I added them, still not working. dropbox.com/s/24yaz6ut7ygkoql/…

                                                    – Mike Purcell
                                                    Aug 29 '17 at 13:45











                                                  • @MikePurcell You don't have autocomplete="off" on the form tag. Also try to put fake inputs immediately after form tag.

                                                    – yivo
                                                    Aug 30 '17 at 8:17














                                                  3












                                                  3








                                                  3







                                                  In Chrome 48+ use this solution:





                                                  1. Put fake fields before real fields:



                                                    <form autocomplete="off">
                                                    <input name="fake_email" class="visually-hidden" type="text">
                                                    <input name="fake_password" class="visually-hidden" type="password">

                                                    <input autocomplete="off" name="email" type="text">
                                                    <input autocomplete="off" name="password" type="password">
                                                    </form>



                                                  2. Hide fake fields:



                                                    .visually-hidden {
                                                    margin: -1px;
                                                    padding: 0;
                                                    width: 1px;
                                                    height: 1px;
                                                    overflow: hidden;
                                                    clip: rect(0 0 0 0);
                                                    clip: rect(0, 0, 0, 0);
                                                    position: absolute;
                                                    }


                                                  3. You did it!



                                                  Also this will work for older versions.






                                                  share|improve this answer















                                                  In Chrome 48+ use this solution:





                                                  1. Put fake fields before real fields:



                                                    <form autocomplete="off">
                                                    <input name="fake_email" class="visually-hidden" type="text">
                                                    <input name="fake_password" class="visually-hidden" type="password">

                                                    <input autocomplete="off" name="email" type="text">
                                                    <input autocomplete="off" name="password" type="password">
                                                    </form>



                                                  2. Hide fake fields:



                                                    .visually-hidden {
                                                    margin: -1px;
                                                    padding: 0;
                                                    width: 1px;
                                                    height: 1px;
                                                    overflow: hidden;
                                                    clip: rect(0 0 0 0);
                                                    clip: rect(0, 0, 0, 0);
                                                    position: absolute;
                                                    }


                                                  3. You did it!



                                                  Also this will work for older versions.







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited May 7 '16 at 21:58

























                                                  answered May 7 '16 at 13:59









                                                  yivoyivo

                                                  1,5901914




                                                  1,5901914













                                                  • This works for me with Chrome 52...

                                                    – Daniel Bleisteiner
                                                    Aug 1 '16 at 11:38











                                                  • Anyone confirm if this is working for version 60? Tried implementing and doesn't appear to work except for incognito :(

                                                    – Mike Purcell
                                                    Aug 28 '17 at 18:57











                                                  • @MikePurcell It works for me. I have OS X 10.12.4 and Chrome 60.0.3112.101. See screenshots what you actually should have: dropbox.com/s/11btbxl469hagbt/… and dropbox.com/s/73nom28iewd8z8m/…

                                                    – yivo
                                                    Aug 29 '17 at 9:32













                                                  • @yivo Looks like the only diff between urs and og answer is the !important tags, so I added them, still not working. dropbox.com/s/24yaz6ut7ygkoql/…

                                                    – Mike Purcell
                                                    Aug 29 '17 at 13:45











                                                  • @MikePurcell You don't have autocomplete="off" on the form tag. Also try to put fake inputs immediately after form tag.

                                                    – yivo
                                                    Aug 30 '17 at 8:17



















                                                  • This works for me with Chrome 52...

                                                    – Daniel Bleisteiner
                                                    Aug 1 '16 at 11:38











                                                  • Anyone confirm if this is working for version 60? Tried implementing and doesn't appear to work except for incognito :(

                                                    – Mike Purcell
                                                    Aug 28 '17 at 18:57











                                                  • @MikePurcell It works for me. I have OS X 10.12.4 and Chrome 60.0.3112.101. See screenshots what you actually should have: dropbox.com/s/11btbxl469hagbt/… and dropbox.com/s/73nom28iewd8z8m/…

                                                    – yivo
                                                    Aug 29 '17 at 9:32













                                                  • @yivo Looks like the only diff between urs and og answer is the !important tags, so I added them, still not working. dropbox.com/s/24yaz6ut7ygkoql/…

                                                    – Mike Purcell
                                                    Aug 29 '17 at 13:45











                                                  • @MikePurcell You don't have autocomplete="off" on the form tag. Also try to put fake inputs immediately after form tag.

                                                    – yivo
                                                    Aug 30 '17 at 8:17

















                                                  This works for me with Chrome 52...

                                                  – Daniel Bleisteiner
                                                  Aug 1 '16 at 11:38





                                                  This works for me with Chrome 52...

                                                  – Daniel Bleisteiner
                                                  Aug 1 '16 at 11:38













                                                  Anyone confirm if this is working for version 60? Tried implementing and doesn't appear to work except for incognito :(

                                                  – Mike Purcell
                                                  Aug 28 '17 at 18:57





                                                  Anyone confirm if this is working for version 60? Tried implementing and doesn't appear to work except for incognito :(

                                                  – Mike Purcell
                                                  Aug 28 '17 at 18:57













                                                  @MikePurcell It works for me. I have OS X 10.12.4 and Chrome 60.0.3112.101. See screenshots what you actually should have: dropbox.com/s/11btbxl469hagbt/… and dropbox.com/s/73nom28iewd8z8m/…

                                                  – yivo
                                                  Aug 29 '17 at 9:32







                                                  @MikePurcell It works for me. I have OS X 10.12.4 and Chrome 60.0.3112.101. See screenshots what you actually should have: dropbox.com/s/11btbxl469hagbt/… and dropbox.com/s/73nom28iewd8z8m/…

                                                  – yivo
                                                  Aug 29 '17 at 9:32















                                                  @yivo Looks like the only diff between urs and og answer is the !important tags, so I added them, still not working. dropbox.com/s/24yaz6ut7ygkoql/…

                                                  – Mike Purcell
                                                  Aug 29 '17 at 13:45





                                                  @yivo Looks like the only diff between urs and og answer is the !important tags, so I added them, still not working. dropbox.com/s/24yaz6ut7ygkoql/…

                                                  – Mike Purcell
                                                  Aug 29 '17 at 13:45













                                                  @MikePurcell You don't have autocomplete="off" on the form tag. Also try to put fake inputs immediately after form tag.

                                                  – yivo
                                                  Aug 30 '17 at 8:17





                                                  @MikePurcell You don't have autocomplete="off" on the form tag. Also try to put fake inputs immediately after form tag.

                                                  – yivo
                                                  Aug 30 '17 at 8:17











                                                  3














                                                  TL;DR: Tell Chrome that this is a new password input and it won't provide old ones as autocomplete suggestions:



                                                  <input type="password" name="password" autocomplete="new-password">




                                                  autocomplete="off" doesn't work due to a design decision - lots of research shows that users have much longer and harder to hack passwords if they can store them in a browser or password manager.



                                                  The specification for autocomplete has changed, and now supports various values to make login forms easy to auto complete:



                                                  <!-- Auto fills with the username for the site, even though it's email format -->
                                                  <input type="email" name="email" autocomplete="username">

                                                  <!-- current-password will populate for the matched username input -->
                                                  <input type="password" autocomplete="current-password" />


                                                  If you don't provide these Chrome still tries to guess, and when it does it ignores autocomplete="off".



                                                  The solution is that autocomplete values also exist for password reset forms:



                                                  <label>Enter your old password:
                                                  <input type="password" autocomplete="current-password" name="pass-old" />
                                                  </label>
                                                  <label>Enter your new password:
                                                  <input type="password" autocomplete="new-password" name="pass-new" />
                                                  </label>
                                                  <label>Please repeat it to be sure:
                                                  <input type="password" autocomplete="new-password" name="pass-repeat" />
                                                  </label>


                                                  You can use this autocomplete="new-password" flag to tell Chrome not to guess the password, even if it has one stored for this site.



                                                  Chrome can also manage passwords for sites directly using the credentials API, which is a standard and will probably have universal support eventually.






                                                  share|improve this answer





















                                                  • 4





                                                    Not a really compelling reason. The fact that the user wants something doesn't mean it is a smart idea. That's almost as bad as saying you will allow single character passwords in your application because the user finds it more convenient. At times, security trumps convenience...

                                                    – Daniel Kotin
                                                    Jul 22 '14 at 13:28











                                                  • @Infinitesimus - good point, but with password complexity you're protecting the user from someone cracking the password, i.e. something out of their control. Here the hacking risk is that they could leave their machine unlocked and someone use autocompete to log in as them or something similar. That's something very much in control of the user, and whether they're trusted to autofill forms should be up to the administrator of the machine, not each individual application. Personally I hate sites that won't cache my form inputs, but if I was administrator I'd turn autofill off for my users.

                                                    – Keith
                                                    Jul 22 '14 at 15:27











                                                  • I have a field called "ContactNoAlt" that Chrome insists on filling with an EmailAddress. Autocomplete on/off is preferred but a work-around is needed on a practical level because Chrome is falible. More pointedly autocomplete="off" is a standard - so what makes the developers of Chrome so good that they just feel they can ignore standards - perhaps one day Chrome will decide some other piece of HTML is inconvenient .... (this is starting to feel like IE5/6 de-ja-vu)

                                                    – dunxz
                                                    Aug 3 '14 at 21:38













                                                  • I'm a chrome user, and I don't want this behaviour. It didn't even ask me before it autofilled the password box that was popping up to make sure only I could access the web application concerned. Saving some passwords shouldn't mean autocompleting all passwords.

                                                    – Hippyjim
                                                    Mar 3 '15 at 10:15






                                                  • 1





                                                    This answer (and Googles behaviour) ignore the fact that one of the major reasons you might want to do this is to implement your own (e.g, list from database) autocompletion behaviours.

                                                    – squarelogic.hayden
                                                    Aug 13 '15 at 14:30
















                                                  3














                                                  TL;DR: Tell Chrome that this is a new password input and it won't provide old ones as autocomplete suggestions:



                                                  <input type="password" name="password" autocomplete="new-password">




                                                  autocomplete="off" doesn't work due to a design decision - lots of research shows that users have much longer and harder to hack passwords if they can store them in a browser or password manager.



                                                  The specification for autocomplete has changed, and now supports various values to make login forms easy to auto complete:



                                                  <!-- Auto fills with the username for the site, even though it's email format -->
                                                  <input type="email" name="email" autocomplete="username">

                                                  <!-- current-password will populate for the matched username input -->
                                                  <input type="password" autocomplete="current-password" />


                                                  If you don't provide these Chrome still tries to guess, and when it does it ignores autocomplete="off".



                                                  The solution is that autocomplete values also exist for password reset forms:



                                                  <label>Enter your old password:
                                                  <input type="password" autocomplete="current-password" name="pass-old" />
                                                  </label>
                                                  <label>Enter your new password:
                                                  <input type="password" autocomplete="new-password" name="pass-new" />
                                                  </label>
                                                  <label>Please repeat it to be sure:
                                                  <input type="password" autocomplete="new-password" name="pass-repeat" />
                                                  </label>


                                                  You can use this autocomplete="new-password" flag to tell Chrome not to guess the password, even if it has one stored for this site.



                                                  Chrome can also manage passwords for sites directly using the credentials API, which is a standard and will probably have universal support eventually.






                                                  share|improve this answer





















                                                  • 4





                                                    Not a really compelling reason. The fact that the user wants something doesn't mean it is a smart idea. That's almost as bad as saying you will allow single character passwords in your application because the user finds it more convenient. At times, security trumps convenience...

                                                    – Daniel Kotin
                                                    Jul 22 '14 at 13:28











                                                  • @Infinitesimus - good point, but with password complexity you're protecting the user from someone cracking the password, i.e. something out of their control. Here the hacking risk is that they could leave their machine unlocked and someone use autocompete to log in as them or something similar. That's something very much in control of the user, and whether they're trusted to autofill forms should be up to the administrator of the machine, not each individual application. Personally I hate sites that won't cache my form inputs, but if I was administrator I'd turn autofill off for my users.

                                                    – Keith
                                                    Jul 22 '14 at 15:27











                                                  • I have a field called "ContactNoAlt" that Chrome insists on filling with an EmailAddress. Autocomplete on/off is preferred but a work-around is needed on a practical level because Chrome is falible. More pointedly autocomplete="off" is a standard - so what makes the developers of Chrome so good that they just feel they can ignore standards - perhaps one day Chrome will decide some other piece of HTML is inconvenient .... (this is starting to feel like IE5/6 de-ja-vu)

                                                    – dunxz
                                                    Aug 3 '14 at 21:38













                                                  • I'm a chrome user, and I don't want this behaviour. It didn't even ask me before it autofilled the password box that was popping up to make sure only I could access the web application concerned. Saving some passwords shouldn't mean autocompleting all passwords.

                                                    – Hippyjim
                                                    Mar 3 '15 at 10:15






                                                  • 1





                                                    This answer (and Googles behaviour) ignore the fact that one of the major reasons you might want to do this is to implement your own (e.g, list from database) autocompletion behaviours.

                                                    – squarelogic.hayden
                                                    Aug 13 '15 at 14:30














                                                  3












                                                  3








                                                  3







                                                  TL;DR: Tell Chrome that this is a new password input and it won't provide old ones as autocomplete suggestions:



                                                  <input type="password" name="password" autocomplete="new-password">




                                                  autocomplete="off" doesn't work due to a design decision - lots of research shows that users have much longer and harder to hack passwords if they can store them in a browser or password manager.



                                                  The specification for autocomplete has changed, and now supports various values to make login forms easy to auto complete:



                                                  <!-- Auto fills with the username for the site, even though it's email format -->
                                                  <input type="email" name="email" autocomplete="username">

                                                  <!-- current-password will populate for the matched username input -->
                                                  <input type="password" autocomplete="current-password" />


                                                  If you don't provide these Chrome still tries to guess, and when it does it ignores autocomplete="off".



                                                  The solution is that autocomplete values also exist for password reset forms:



                                                  <label>Enter your old password:
                                                  <input type="password" autocomplete="current-password" name="pass-old" />
                                                  </label>
                                                  <label>Enter your new password:
                                                  <input type="password" autocomplete="new-password" name="pass-new" />
                                                  </label>
                                                  <label>Please repeat it to be sure:
                                                  <input type="password" autocomplete="new-password" name="pass-repeat" />
                                                  </label>


                                                  You can use this autocomplete="new-password" flag to tell Chrome not to guess the password, even if it has one stored for this site.



                                                  Chrome can also manage passwords for sites directly using the credentials API, which is a standard and will probably have universal support eventually.






                                                  share|improve this answer















                                                  TL;DR: Tell Chrome that this is a new password input and it won't provide old ones as autocomplete suggestions:



                                                  <input type="password" name="password" autocomplete="new-password">




                                                  autocomplete="off" doesn't work due to a design decision - lots of research shows that users have much longer and harder to hack passwords if they can store them in a browser or password manager.



                                                  The specification for autocomplete has changed, and now supports various values to make login forms easy to auto complete:



                                                  <!-- Auto fills with the username for the site, even though it's email format -->
                                                  <input type="email" name="email" autocomplete="username">

                                                  <!-- current-password will populate for the matched username input -->
                                                  <input type="password" autocomplete="current-password" />


                                                  If you don't provide these Chrome still tries to guess, and when it does it ignores autocomplete="off".



                                                  The solution is that autocomplete values also exist for password reset forms:



                                                  <label>Enter your old password:
                                                  <input type="password" autocomplete="current-password" name="pass-old" />
                                                  </label>
                                                  <label>Enter your new password:
                                                  <input type="password" autocomplete="new-password" name="pass-new" />
                                                  </label>
                                                  <label>Please repeat it to be sure:
                                                  <input type="password" autocomplete="new-password" name="pass-repeat" />
                                                  </label>


                                                  You can use this autocomplete="new-password" flag to tell Chrome not to guess the password, even if it has one stored for this site.



                                                  Chrome can also manage passwords for sites directly using the credentials API, which is a standard and will probably have universal support eventually.







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited May 3 '17 at 7:42

























                                                  answered Jul 22 '14 at 9:43









                                                  KeithKeith

                                                  95k59236354




                                                  95k59236354








                                                  • 4





                                                    Not a really compelling reason. The fact that the user wants something doesn't mean it is a smart idea. That's almost as bad as saying you will allow single character passwords in your application because the user finds it more convenient. At times, security trumps convenience...

                                                    – Daniel Kotin
                                                    Jul 22 '14 at 13:28











                                                  • @Infinitesimus - good point, but with password complexity you're protecting the user from someone cracking the password, i.e. something out of their control. Here the hacking risk is that they could leave their machine unlocked and someone use autocompete to log in as them or something similar. That's something very much in control of the user, and whether they're trusted to autofill forms should be up to the administrator of the machine, not each individual application. Personally I hate sites that won't cache my form inputs, but if I was administrator I'd turn autofill off for my users.

                                                    – Keith
                                                    Jul 22 '14 at 15:27











                                                  • I have a field called "ContactNoAlt" that Chrome insists on filling with an EmailAddress. Autocomplete on/off is preferred but a work-around is needed on a practical level because Chrome is falible. More pointedly autocomplete="off" is a standard - so what makes the developers of Chrome so good that they just feel they can ignore standards - perhaps one day Chrome will decide some other piece of HTML is inconvenient .... (this is starting to feel like IE5/6 de-ja-vu)

                                                    – dunxz
                                                    Aug 3 '14 at 21:38













                                                  • I'm a chrome user, and I don't want this behaviour. It didn't even ask me before it autofilled the password box that was popping up to make sure only I could access the web application concerned. Saving some passwords shouldn't mean autocompleting all passwords.

                                                    – Hippyjim
                                                    Mar 3 '15 at 10:15






                                                  • 1





                                                    This answer (and Googles behaviour) ignore the fact that one of the major reasons you might want to do this is to implement your own (e.g, list from database) autocompletion behaviours.

                                                    – squarelogic.hayden
                                                    Aug 13 '15 at 14:30














                                                  • 4





                                                    Not a really compelling reason. The fact that the user wants something doesn't mean it is a smart idea. That's almost as bad as saying you will allow single character passwords in your application because the user finds it more convenient. At times, security trumps convenience...

                                                    – Daniel Kotin
                                                    Jul 22 '14 at 13:28











                                                  • @Infinitesimus - good point, but with password complexity you're protecting the user from someone cracking the password, i.e. something out of their control. Here the hacking risk is that they could leave their machine unlocked and someone use autocompete to log in as them or something similar. That's something very much in control of the user, and whether they're trusted to autofill forms should be up to the administrator of the machine, not each individual application. Personally I hate sites that won't cache my form inputs, but if I was administrator I'd turn autofill off for my users.

                                                    – Keith
                                                    Jul 22 '14 at 15:27











                                                  • I have a field called "ContactNoAlt" that Chrome insists on filling with an EmailAddress. Autocomplete on/off is preferred but a work-around is needed on a practical level because Chrome is falible. More pointedly autocomplete="off" is a standard - so what makes the developers of Chrome so good that they just feel they can ignore standards - perhaps one day Chrome will decide some other piece of HTML is inconvenient .... (this is starting to feel like IE5/6 de-ja-vu)

                                                    – dunxz
                                                    Aug 3 '14 at 21:38













                                                  • I'm a chrome user, and I don't want this behaviour. It didn't even ask me before it autofilled the password box that was popping up to make sure only I could access the web application concerned. Saving some passwords shouldn't mean autocompleting all passwords.

                                                    – Hippyjim
                                                    Mar 3 '15 at 10:15






                                                  • 1





                                                    This answer (and Googles behaviour) ignore the fact that one of the major reasons you might want to do this is to implement your own (e.g, list from database) autocompletion behaviours.

                                                    – squarelogic.hayden
                                                    Aug 13 '15 at 14:30








                                                  4




                                                  4





                                                  Not a really compelling reason. The fact that the user wants something doesn't mean it is a smart idea. That's almost as bad as saying you will allow single character passwords in your application because the user finds it more convenient. At times, security trumps convenience...

                                                  – Daniel Kotin
                                                  Jul 22 '14 at 13:28





                                                  Not a really compelling reason. The fact that the user wants something doesn't mean it is a smart idea. That's almost as bad as saying you will allow single character passwords in your application because the user finds it more convenient. At times, security trumps convenience...

                                                  – Daniel Kotin
                                                  Jul 22 '14 at 13:28













                                                  @Infinitesimus - good point, but with password complexity you're protecting the user from someone cracking the password, i.e. something out of their control. Here the hacking risk is that they could leave their machine unlocked and someone use autocompete to log in as them or something similar. That's something very much in control of the user, and whether they're trusted to autofill forms should be up to the administrator of the machine, not each individual application. Personally I hate sites that won't cache my form inputs, but if I was administrator I'd turn autofill off for my users.

                                                  – Keith
                                                  Jul 22 '14 at 15:27





                                                  @Infinitesimus - good point, but with password complexity you're protecting the user from someone cracking the password, i.e. something out of their control. Here the hacking risk is that they could leave their machine unlocked and someone use autocompete to log in as them or something similar. That's something very much in control of the user, and whether they're trusted to autofill forms should be up to the administrator of the machine, not each individual application. Personally I hate sites that won't cache my form inputs, but if I was administrator I'd turn autofill off for my users.

                                                  – Keith
                                                  Jul 22 '14 at 15:27













                                                  I have a field called "ContactNoAlt" that Chrome insists on filling with an EmailAddress. Autocomplete on/off is preferred but a work-around is needed on a practical level because Chrome is falible. More pointedly autocomplete="off" is a standard - so what makes the developers of Chrome so good that they just feel they can ignore standards - perhaps one day Chrome will decide some other piece of HTML is inconvenient .... (this is starting to feel like IE5/6 de-ja-vu)

                                                  – dunxz
                                                  Aug 3 '14 at 21:38







                                                  I have a field called "ContactNoAlt" that Chrome insists on filling with an EmailAddress. Autocomplete on/off is preferred but a work-around is needed on a practical level because Chrome is falible. More pointedly autocomplete="off" is a standard - so what makes the developers of Chrome so good that they just feel they can ignore standards - perhaps one day Chrome will decide some other piece of HTML is inconvenient .... (this is starting to feel like IE5/6 de-ja-vu)

                                                  – dunxz
                                                  Aug 3 '14 at 21:38















                                                  I'm a chrome user, and I don't want this behaviour. It didn't even ask me before it autofilled the password box that was popping up to make sure only I could access the web application concerned. Saving some passwords shouldn't mean autocompleting all passwords.

                                                  – Hippyjim
                                                  Mar 3 '15 at 10:15





                                                  I'm a chrome user, and I don't want this behaviour. It didn't even ask me before it autofilled the password box that was popping up to make sure only I could access the web application concerned. Saving some passwords shouldn't mean autocompleting all passwords.

                                                  – Hippyjim
                                                  Mar 3 '15 at 10:15




                                                  1




                                                  1





                                                  This answer (and Googles behaviour) ignore the fact that one of the major reasons you might want to do this is to implement your own (e.g, list from database) autocompletion behaviours.

                                                  – squarelogic.hayden
                                                  Aug 13 '15 at 14:30





                                                  This answer (and Googles behaviour) ignore the fact that one of the major reasons you might want to do this is to implement your own (e.g, list from database) autocompletion behaviours.

                                                  – squarelogic.hayden
                                                  Aug 13 '15 at 14:30











                                                  3














                                                  I've solved the endless fight with Google Chrome with the use of random characters.



                                                  <input name="name" type="text" autocomplete="rutjfkde">


                                                  Hope that it will help to other people.






                                                  share|improve this answer




























                                                    3














                                                    I've solved the endless fight with Google Chrome with the use of random characters.



                                                    <input name="name" type="text" autocomplete="rutjfkde">


                                                    Hope that it will help to other people.






                                                    share|improve this answer


























                                                      3












                                                      3








                                                      3







                                                      I've solved the endless fight with Google Chrome with the use of random characters.



                                                      <input name="name" type="text" autocomplete="rutjfkde">


                                                      Hope that it will help to other people.






                                                      share|improve this answer













                                                      I've solved the endless fight with Google Chrome with the use of random characters.



                                                      <input name="name" type="text" autocomplete="rutjfkde">


                                                      Hope that it will help to other people.







                                                      share|improve this answer












                                                      share|improve this answer



                                                      share|improve this answer










                                                      answered Aug 4 '18 at 14:23









                                                      stepstep

                                                      6112929




                                                      6112929























                                                          3














                                                          autocomplete="off" works now, so you can just do the following:



                                                          <input id="firstName2" name="firstName2" autocomplete="off">


                                                          Tested in the current Chrome 70 as well as in all versions starting from Chrome 62.



                                                          Demo.



                                                          UPDATE: Since people tend to downvote this (see, for instance, a comment from @AntonKuznetsov down below) before reading the demonstration in the JSFiddle or actually looking into the JSFiddle's HTML, I have to express it clearly:




                                                          • the top input has the auto complete working


                                                          • the bottom input has the auto complete disabled by adding autocomplete="off"






                                                          share|improve this answer


























                                                          • I can confirm this. autocomplete="new-password" appears to no longer work.

                                                            – ShibbyUK
                                                            Sep 3 '18 at 9:56






                                                          • 1





                                                            Tested on Chrome 69, it's working!

                                                            – Matheus Cuba
                                                            Sep 6 '18 at 17:20











                                                          • Does not work — Chrome Version 70.0.3538.102 user-images.githubusercontent.com/1788245/…

                                                            – Anton Kuznetsov
                                                            Nov 15 '18 at 11:12








                                                          • 1





                                                            @AntonKuznetsov Please take a closer look at the JSFiddle's HTML: the bottom input has autocomplete="off", whereas the upper one doesn't. So, the auto completer is meant to be disabled for the bottom input only, but on your screen shot you're testing auto complete on the upper one. Thus, this still is the proper way of disabling the auto complete for Chrome 70. I'd appreciate if you check it out more thoroughly and upvote this one instead of downvoting.

                                                            – Alexander Abakumov
                                                            Nov 15 '18 at 15:53


















                                                          3














                                                          autocomplete="off" works now, so you can just do the following:



                                                          <input id="firstName2" name="firstName2" autocomplete="off">


                                                          Tested in the current Chrome 70 as well as in all versions starting from Chrome 62.



                                                          Demo.



                                                          UPDATE: Since people tend to downvote this (see, for instance, a comment from @AntonKuznetsov down below) before reading the demonstration in the JSFiddle or actually looking into the JSFiddle's HTML, I have to express it clearly:




                                                          • the top input has the auto complete working


                                                          • the bottom input has the auto complete disabled by adding autocomplete="off"






                                                          share|improve this answer


























                                                          • I can confirm this. autocomplete="new-password" appears to no longer work.

                                                            – ShibbyUK
                                                            Sep 3 '18 at 9:56






                                                          • 1





                                                            Tested on Chrome 69, it's working!

                                                            – Matheus Cuba
                                                            Sep 6 '18 at 17:20











                                                          • Does not work — Chrome Version 70.0.3538.102 user-images.githubusercontent.com/1788245/…

                                                            – Anton Kuznetsov
                                                            Nov 15 '18 at 11:12








                                                          • 1





                                                            @AntonKuznetsov Please take a closer look at the JSFiddle's HTML: the bottom input has autocomplete="off", whereas the upper one doesn't. So, the auto completer is meant to be disabled for the bottom input only, but on your screen shot you're testing auto complete on the upper one. Thus, this still is the proper way of disabling the auto complete for Chrome 70. I'd appreciate if you check it out more thoroughly and upvote this one instead of downvoting.

                                                            – Alexander Abakumov
                                                            Nov 15 '18 at 15:53
















                                                          3












                                                          3








                                                          3







                                                          autocomplete="off" works now, so you can just do the following:



                                                          <input id="firstName2" name="firstName2" autocomplete="off">


                                                          Tested in the current Chrome 70 as well as in all versions starting from Chrome 62.



                                                          Demo.



                                                          UPDATE: Since people tend to downvote this (see, for instance, a comment from @AntonKuznetsov down below) before reading the demonstration in the JSFiddle or actually looking into the JSFiddle's HTML, I have to express it clearly:




                                                          • the top input has the auto complete working


                                                          • the bottom input has the auto complete disabled by adding autocomplete="off"






                                                          share|improve this answer















                                                          autocomplete="off" works now, so you can just do the following:



                                                          <input id="firstName2" name="firstName2" autocomplete="off">


                                                          Tested in the current Chrome 70 as well as in all versions starting from Chrome 62.



                                                          Demo.



                                                          UPDATE: Since people tend to downvote this (see, for instance, a comment from @AntonKuznetsov down below) before reading the demonstration in the JSFiddle or actually looking into the JSFiddle's HTML, I have to express it clearly:




                                                          • the top input has the auto complete working


                                                          • the bottom input has the auto complete disabled by adding autocomplete="off"







                                                          share|improve this answer














                                                          share|improve this answer



                                                          share|improve this answer








                                                          edited Nov 15 '18 at 22:10

























                                                          answered Aug 29 '18 at 17:00









                                                          Alexander AbakumovAlexander Abakumov

                                                          4,94354773




                                                          4,94354773













                                                          • I can confirm this. autocomplete="new-password" appears to no longer work.

                                                            – ShibbyUK
                                                            Sep 3 '18 at 9:56






                                                          • 1





                                                            Tested on Chrome 69, it's working!

                                                            – Matheus Cuba
                                                            Sep 6 '18 at 17:20











                                                          • Does not work — Chrome Version 70.0.3538.102 user-images.githubusercontent.com/1788245/…

                                                            – Anton Kuznetsov
                                                            Nov 15 '18 at 11:12








                                                          • 1





                                                            @AntonKuznetsov Please take a closer look at the JSFiddle's HTML: the bottom input has autocomplete="off", whereas the upper one doesn't. So, the auto completer is meant to be disabled for the bottom input only, but on your screen shot you're testing auto complete on the upper one. Thus, this still is the proper way of disabling the auto complete for Chrome 70. I'd appreciate if you check it out more thoroughly and upvote this one instead of downvoting.

                                                            – Alexander Abakumov
                                                            Nov 15 '18 at 15:53





















                                                          • I can confirm this. autocomplete="new-password" appears to no longer work.

                                                            – ShibbyUK
                                                            Sep 3 '18 at 9:56






                                                          • 1





                                                            Tested on Chrome 69, it's working!

                                                            – Matheus Cuba
                                                            Sep 6 '18 at 17:20











                                                          • Does not work — Chrome Version 70.0.3538.102 user-images.githubusercontent.com/1788245/…

                                                            – Anton Kuznetsov
                                                            Nov 15 '18 at 11:12








                                                          • 1





                                                            @AntonKuznetsov Please take a closer look at the JSFiddle's HTML: the bottom input has autocomplete="off", whereas the upper one doesn't. So, the auto completer is meant to be disabled for the bottom input only, but on your screen shot you're testing auto complete on the upper one. Thus, this still is the proper way of disabling the auto complete for Chrome 70. I'd appreciate if you check it out more thoroughly and upvote this one instead of downvoting.

                                                            – Alexander Abakumov
                                                            Nov 15 '18 at 15:53



















                                                          I can confirm this. autocomplete="new-password" appears to no longer work.

                                                          – ShibbyUK
                                                          Sep 3 '18 at 9:56





                                                          I can confirm this. autocomplete="new-password" appears to no longer work.

                                                          – ShibbyUK
                                                          Sep 3 '18 at 9:56




                                                          1




                                                          1





                                                          Tested on Chrome 69, it's working!

                                                          – Matheus Cuba
                                                          Sep 6 '18 at 17:20





                                                          Tested on Chrome 69, it's working!

                                                          – Matheus Cuba
                                                          Sep 6 '18 at 17:20













                                                          Does not work — Chrome Version 70.0.3538.102 user-images.githubusercontent.com/1788245/…

                                                          – Anton Kuznetsov
                                                          Nov 15 '18 at 11:12







                                                          Does not work — Chrome Version 70.0.3538.102 user-images.githubusercontent.com/1788245/…

                                                          – Anton Kuznetsov
                                                          Nov 15 '18 at 11:12






                                                          1




                                                          1





                                                          @AntonKuznetsov Please take a closer look at the JSFiddle's HTML: the bottom input has autocomplete="off", whereas the upper one doesn't. So, the auto completer is meant to be disabled for the bottom input only, but on your screen shot you're testing auto complete on the upper one. Thus, this still is the proper way of disabling the auto complete for Chrome 70. I'd appreciate if you check it out more thoroughly and upvote this one instead of downvoting.

                                                          – Alexander Abakumov
                                                          Nov 15 '18 at 15:53







                                                          @AntonKuznetsov Please take a closer look at the JSFiddle's HTML: the bottom input has autocomplete="off", whereas the upper one doesn't. So, the auto completer is meant to be disabled for the bottom input only, but on your screen shot you're testing auto complete on the upper one. Thus, this still is the proper way of disabling the auto complete for Chrome 70. I'd appreciate if you check it out more thoroughly and upvote this one instead of downvoting.

                                                          – Alexander Abakumov
                                                          Nov 15 '18 at 15:53













                                                          2














                                                          i found this solution to be the most appropriate:



                                                          function clearChromeAutocomplete()
                                                          {
                                                          // not possible, let's try:
                                                          if (navigator.userAgent.toLowerCase().indexOf('chrome') >= 0)
                                                          {
                                                          document.getElementById('adminForm').setAttribute('autocomplete', 'off');
                                                          setTimeout(function () {
                                                          document.getElementById('adminForm').setAttribute('autocomplete', 'on');
                                                          }, 1500);
                                                          }
                                                          }


                                                          It must be loaded after dom ready, or after the form renders.






                                                          share|improve this answer




























                                                            2














                                                            i found this solution to be the most appropriate:



                                                            function clearChromeAutocomplete()
                                                            {
                                                            // not possible, let's try:
                                                            if (navigator.userAgent.toLowerCase().indexOf('chrome') >= 0)
                                                            {
                                                            document.getElementById('adminForm').setAttribute('autocomplete', 'off');
                                                            setTimeout(function () {
                                                            document.getElementById('adminForm').setAttribute('autocomplete', 'on');
                                                            }, 1500);
                                                            }
                                                            }


                                                            It must be loaded after dom ready, or after the form renders.






                                                            share|improve this answer


























                                                              2












                                                              2








                                                              2







                                                              i found this solution to be the most appropriate:



                                                              function clearChromeAutocomplete()
                                                              {
                                                              // not possible, let's try:
                                                              if (navigator.userAgent.toLowerCase().indexOf('chrome') >= 0)
                                                              {
                                                              document.getElementById('adminForm').setAttribute('autocomplete', 'off');
                                                              setTimeout(function () {
                                                              document.getElementById('adminForm').setAttribute('autocomplete', 'on');
                                                              }, 1500);
                                                              }
                                                              }


                                                              It must be loaded after dom ready, or after the form renders.






                                                              share|improve this answer













                                                              i found this solution to be the most appropriate:



                                                              function clearChromeAutocomplete()
                                                              {
                                                              // not possible, let's try:
                                                              if (navigator.userAgent.toLowerCase().indexOf('chrome') >= 0)
                                                              {
                                                              document.getElementById('adminForm').setAttribute('autocomplete', 'off');
                                                              setTimeout(function () {
                                                              document.getElementById('adminForm').setAttribute('autocomplete', 'on');
                                                              }, 1500);
                                                              }
                                                              }


                                                              It must be loaded after dom ready, or after the form renders.







                                                              share|improve this answer












                                                              share|improve this answer



                                                              share|improve this answer










                                                              answered Jun 13 '13 at 16:19









                                                              user2241415user2241415

                                                              511




                                                              511























                                                                  2














                                                                  Whilst I agree autocomplete should be a user choice, there are times when Chrome is over-zealous with it (other browsers may be too). For instance, a password field with a different name is still auto-filled with a saved password and the previous field populated with the username. This particularly sucks when the form is a user management form for a web app and you don't want autofill to populate it with your own credentials.



                                                                  Chrome completely ignores autocomplete="off" now. Whilst the JS hacks may well work, I found a simple way which works at the time of writing:



                                                                  Set the value of the password field to the control character 8 ("x08" in PHP or &#8; in HTML). This stops Chrome auto-filling the field because it has a value, but no actual value is entered because this is the backspace character.



                                                                  Yes this is still a hack, but it works for me. YMMV.






                                                                  share|improve this answer
























                                                                  • Care to explain the down vote? The accepted answer doesn't even work and is also a kludge, which I accept mine is too. At least mine works and does actually answer the question.

                                                                    – spikyjt
                                                                    Nov 24 '14 at 14:40











                                                                  • Doesn't seem to work in Chrome 40

                                                                    – hood
                                                                    Jan 28 '15 at 5:14











                                                                  • Prefilled values seem to be getting overwritten now :(

                                                                    – Hippyjim
                                                                    Mar 3 '15 at 10:12











                                                                  • I think they've picked up this hack and ignored control characters in the value, so it now evaluates to empty. See the answer by @ice-cream stackoverflow.com/a/16130452/752696 for the correct, up-to-date solution.

                                                                    – spikyjt
                                                                    Mar 5 '15 at 11:44













                                                                  • Same use case here: Working with user management and having own credentials autofilled. However since it's my own code and I reuse the form for creating new and editing existing users simply overriding input values via JS removed the auto-complete.

                                                                    – nuala
                                                                    Apr 5 '15 at 12:21
















                                                                  2














                                                                  Whilst I agree autocomplete should be a user choice, there are times when Chrome is over-zealous with it (other browsers may be too). For instance, a password field with a different name is still auto-filled with a saved password and the previous field populated with the username. This particularly sucks when the form is a user management form for a web app and you don't want autofill to populate it with your own credentials.



                                                                  Chrome completely ignores autocomplete="off" now. Whilst the JS hacks may well work, I found a simple way which works at the time of writing:



                                                                  Set the value of the password field to the control character 8 ("x08" in PHP or &#8; in HTML). This stops Chrome auto-filling the field because it has a value, but no actual value is entered because this is the backspace character.



                                                                  Yes this is still a hack, but it works for me. YMMV.






                                                                  share|improve this answer
























                                                                  • Care to explain the down vote? The accepted answer doesn't even work and is also a kludge, which I accept mine is too. At least mine works and does actually answer the question.

                                                                    – spikyjt
                                                                    Nov 24 '14 at 14:40











                                                                  • Doesn't seem to work in Chrome 40

                                                                    – hood
                                                                    Jan 28 '15 at 5:14











                                                                  • Prefilled values seem to be getting overwritten now :(

                                                                    – Hippyjim
                                                                    Mar 3 '15 at 10:12











                                                                  • I think they've picked up this hack and ignored control characters in the value, so it now evaluates to empty. See the answer by @ice-cream stackoverflow.com/a/16130452/752696 for the correct, up-to-date solution.

                                                                    – spikyjt
                                                                    Mar 5 '15 at 11:44













                                                                  • Same use case here: Working with user management and having own credentials autofilled. However since it's my own code and I reuse the form for creating new and editing existing users simply overriding input values via JS removed the auto-complete.

                                                                    – nuala
                                                                    Apr 5 '15 at 12:21














                                                                  2












                                                                  2








                                                                  2







                                                                  Whilst I agree autocomplete should be a user choice, there are times when Chrome is over-zealous with it (other browsers may be too). For instance, a password field with a different name is still auto-filled with a saved password and the previous field populated with the username. This particularly sucks when the form is a user management form for a web app and you don't want autofill to populate it with your own credentials.



                                                                  Chrome completely ignores autocomplete="off" now. Whilst the JS hacks may well work, I found a simple way which works at the time of writing:



                                                                  Set the value of the password field to the control character 8 ("x08" in PHP or &#8; in HTML). This stops Chrome auto-filling the field because it has a value, but no actual value is entered because this is the backspace character.



                                                                  Yes this is still a hack, but it works for me. YMMV.






                                                                  share|improve this answer













                                                                  Whilst I agree autocomplete should be a user choice, there are times when Chrome is over-zealous with it (other browsers may be too). For instance, a password field with a different name is still auto-filled with a saved password and the previous field populated with the username. This particularly sucks when the form is a user management form for a web app and you don't want autofill to populate it with your own credentials.



                                                                  Chrome completely ignores autocomplete="off" now. Whilst the JS hacks may well work, I found a simple way which works at the time of writing:



                                                                  Set the value of the password field to the control character 8 ("x08" in PHP or &#8; in HTML). This stops Chrome auto-filling the field because it has a value, but no actual value is entered because this is the backspace character.



                                                                  Yes this is still a hack, but it works for me. YMMV.







                                                                  share|improve this answer












                                                                  share|improve this answer



                                                                  share|improve this answer










                                                                  answered Jul 25 '14 at 10:55









                                                                  spikyjtspikyjt

                                                                  1,4001315




                                                                  1,4001315













                                                                  • Care to explain the down vote? The accepted answer doesn't even work and is also a kludge, which I accept mine is too. At least mine works and does actually answer the question.

                                                                    – spikyjt
                                                                    Nov 24 '14 at 14:40











                                                                  • Doesn't seem to work in Chrome 40

                                                                    – hood
                                                                    Jan 28 '15 at 5:14











                                                                  • Prefilled values seem to be getting overwritten now :(

                                                                    – Hippyjim
                                                                    Mar 3 '15 at 10:12











                                                                  • I think they've picked up this hack and ignored control characters in the value, so it now evaluates to empty. See the answer by @ice-cream stackoverflow.com/a/16130452/752696 for the correct, up-to-date solution.

                                                                    – spikyjt
                                                                    Mar 5 '15 at 11:44













                                                                  • Same use case here: Working with user management and having own credentials autofilled. However since it's my own code and I reuse the form for creating new and editing existing users simply overriding input values via JS removed the auto-complete.

                                                                    – nuala
                                                                    Apr 5 '15 at 12:21



















                                                                  • Care to explain the down vote? The accepted answer doesn't even work and is also a kludge, which I accept mine is too. At least mine works and does actually answer the question.

                                                                    – spikyjt
                                                                    Nov 24 '14 at 14:40











                                                                  • Doesn't seem to work in Chrome 40

                                                                    – hood
                                                                    Jan 28 '15 at 5:14











                                                                  • Prefilled values seem to be getting overwritten now :(

                                                                    – Hippyjim
                                                                    Mar 3 '15 at 10:12











                                                                  • I think they've picked up this hack and ignored control characters in the value, so it now evaluates to empty. See the answer by @ice-cream stackoverflow.com/a/16130452/752696 for the correct, up-to-date solution.

                                                                    – spikyjt
                                                                    Mar 5 '15 at 11:44













                                                                  • Same use case here: Working with user management and having own credentials autofilled. However since it's my own code and I reuse the form for creating new and editing existing users simply overriding input values via JS removed the auto-complete.

                                                                    – nuala
                                                                    Apr 5 '15 at 12:21

















                                                                  Care to explain the down vote? The accepted answer doesn't even work and is also a kludge, which I accept mine is too. At least mine works and does actually answer the question.

                                                                  – spikyjt
                                                                  Nov 24 '14 at 14:40





                                                                  Care to explain the down vote? The accepted answer doesn't even work and is also a kludge, which I accept mine is too. At least mine works and does actually answer the question.

                                                                  – spikyjt
                                                                  Nov 24 '14 at 14:40













                                                                  Doesn't seem to work in Chrome 40

                                                                  – hood
                                                                  Jan 28 '15 at 5:14





                                                                  Doesn't seem to work in Chrome 40

                                                                  – hood
                                                                  Jan 28 '15 at 5:14













                                                                  Prefilled values seem to be getting overwritten now :(

                                                                  – Hippyjim
                                                                  Mar 3 '15 at 10:12





                                                                  Prefilled values seem to be getting overwritten now :(

                                                                  – Hippyjim
                                                                  Mar 3 '15 at 10:12













                                                                  I think they've picked up this hack and ignored control characters in the value, so it now evaluates to empty. See the answer by @ice-cream stackoverflow.com/a/16130452/752696 for the correct, up-to-date solution.

                                                                  – spikyjt
                                                                  Mar 5 '15 at 11:44







                                                                  I think they've picked up this hack and ignored control characters in the value, so it now evaluates to empty. See the answer by @ice-cream stackoverflow.com/a/16130452/752696 for the correct, up-to-date solution.

                                                                  – spikyjt
                                                                  Mar 5 '15 at 11:44















                                                                  Same use case here: Working with user management and having own credentials autofilled. However since it's my own code and I reuse the form for creating new and editing existing users simply overriding input values via JS removed the auto-complete.

                                                                  – nuala
                                                                  Apr 5 '15 at 12:21





                                                                  Same use case here: Working with user management and having own credentials autofilled. However since it's my own code and I reuse the form for creating new and editing existing users simply overriding input values via JS removed the auto-complete.

                                                                  – nuala
                                                                  Apr 5 '15 at 12:21











                                                                  2














                                                                  I solved in another way. You can try this.



                                                                  <input id="passfld" type="text" autocomplete="off" />
                                                                  <script type="text/javascript">
                                                                  // Using jQuery
                                                                  $(function(){
                                                                  setTimeout(function(){
                                                                  $("input#passfld").attr("type","password");
                                                                  },10);
                                                                  });


                                                                  // or in pure javascript
                                                                  window.onload=function(){
                                                                  setTimeout(function(){
                                                                  document.getElementById('passfld').type = 'password';
                                                                  },10);
                                                                  }
                                                                  </script>





                                                                  share|improve this answer




























                                                                    2














                                                                    I solved in another way. You can try this.



                                                                    <input id="passfld" type="text" autocomplete="off" />
                                                                    <script type="text/javascript">
                                                                    // Using jQuery
                                                                    $(function(){
                                                                    setTimeout(function(){
                                                                    $("input#passfld").attr("type","password");
                                                                    },10);
                                                                    });


                                                                    // or in pure javascript
                                                                    window.onload=function(){
                                                                    setTimeout(function(){
                                                                    document.getElementById('passfld').type = 'password';
                                                                    },10);
                                                                    }
                                                                    </script>





                                                                    share|improve this answer


























                                                                      2












                                                                      2








                                                                      2







                                                                      I solved in another way. You can try this.



                                                                      <input id="passfld" type="text" autocomplete="off" />
                                                                      <script type="text/javascript">
                                                                      // Using jQuery
                                                                      $(function(){
                                                                      setTimeout(function(){
                                                                      $("input#passfld").attr("type","password");
                                                                      },10);
                                                                      });


                                                                      // or in pure javascript
                                                                      window.onload=function(){
                                                                      setTimeout(function(){
                                                                      document.getElementById('passfld').type = 'password';
                                                                      },10);
                                                                      }
                                                                      </script>





                                                                      share|improve this answer













                                                                      I solved in another way. You can try this.



                                                                      <input id="passfld" type="text" autocomplete="off" />
                                                                      <script type="text/javascript">
                                                                      // Using jQuery
                                                                      $(function(){
                                                                      setTimeout(function(){
                                                                      $("input#passfld").attr("type","password");
                                                                      },10);
                                                                      });


                                                                      // or in pure javascript
                                                                      window.onload=function(){
                                                                      setTimeout(function(){
                                                                      document.getElementById('passfld').type = 'password';
                                                                      },10);
                                                                      }
                                                                      </script>






                                                                      share|improve this answer












                                                                      share|improve this answer



                                                                      share|improve this answer










                                                                      answered Sep 30 '14 at 6:45









                                                                      SarwarCSESarwarCSE

                                                                      97111021




                                                                      97111021























                                                                          2














                                                                          I had a similar issue where the input field took either a name or an email. I set autocomplete="off" but Chrome still forced suggestions. Turns out it was because the placeholder text had the words "name" and "email" in it.



                                                                          For example



                                                                          <input type="text" placeholder="name or email" autocomplete="off" />


                                                                          I got around it by putting a zero width space into the words in the placeholder. No more Chrome autocomplete.



                                                                          <input type="text" placeholder="nam​e or emai​l" autocomplete="off" />





                                                                          share|improve this answer






























                                                                            2














                                                                            I had a similar issue where the input field took either a name or an email. I set autocomplete="off" but Chrome still forced suggestions. Turns out it was because the placeholder text had the words "name" and "email" in it.



                                                                            For example



                                                                            <input type="text" placeholder="name or email" autocomplete="off" />


                                                                            I got around it by putting a zero width space into the words in the placeholder. No more Chrome autocomplete.



                                                                            <input type="text" placeholder="nam​e or emai​l" autocomplete="off" />





                                                                            share|improve this answer




























                                                                              2












                                                                              2








                                                                              2







                                                                              I had a similar issue where the input field took either a name or an email. I set autocomplete="off" but Chrome still forced suggestions. Turns out it was because the placeholder text had the words "name" and "email" in it.



                                                                              For example



                                                                              <input type="text" placeholder="name or email" autocomplete="off" />


                                                                              I got around it by putting a zero width space into the words in the placeholder. No more Chrome autocomplete.



                                                                              <input type="text" placeholder="nam​e or emai​l" autocomplete="off" />





                                                                              share|improve this answer















                                                                              I had a similar issue where the input field took either a name or an email. I set autocomplete="off" but Chrome still forced suggestions. Turns out it was because the placeholder text had the words "name" and "email" in it.



                                                                              For example



                                                                              <input type="text" placeholder="name or email" autocomplete="off" />


                                                                              I got around it by putting a zero width space into the words in the placeholder. No more Chrome autocomplete.



                                                                              <input type="text" placeholder="nam​e or emai​l" autocomplete="off" />






                                                                              share|improve this answer














                                                                              share|improve this answer



                                                                              share|improve this answer








                                                                              edited Sep 15 '15 at 14:05









                                                                              durron597

                                                                              27.3k1074135




                                                                              27.3k1074135










                                                                              answered Sep 15 '15 at 13:57









                                                                              WDuffyWDuffy

                                                                              5,80942938




                                                                              5,80942938






















                                                                                  1 2
                                                                                  next


                                                                                  Popular posts from this blog

                                                                                  Monofisismo

                                                                                  Angular Downloading a file using contenturl with Basic Authentication

                                                                                  Olmecas