2

I have an input:

<input type="password" id="confirmPassoword" autocomplete="off"/>

When I am typing into this input in Google Chrome, I get the message the same as here:

enter image description here

How can I get rid of this?

uksz
  • 16,691
  • 26
  • 76
  • 142
  • 3
    Why would you want to do that? The user should decide whether they want to use their browser’s password manager or not. IMHO you’d be _decreasing_ security by interfering at this point. (For example in regard to phishing - the user might get fooled by a URL “similar” to that one of the real site; the browser’s password manager won’t - so if it doesn’t offer pre-filling for a site the user knows they regularly visit and have stored there login credentials for, then something is wrong.) – CBroe Aug 19 '16 at 10:43
  • 1
    @CBroe It's clearly a *choose a new password* form. In those cases it may be of little use. – Álvaro González Aug 19 '16 at 10:49
  • Maybe [this answer](http://stackoverflow.com/a/15917221/2206892) is useful to you. – HP's 411 Aug 19 '16 at 10:49
  • @ÁlvaroGonzález: It may not be, or it might as well be nevertheless. Users might want to use the same password they are using for something else already (whether that’s advisable or not is not the issue here; even without pre-filling by the browser those people will type their “standard” password in.) Main point being: Don’t try and “know better” how users should handle their login credentials; that almost always results in a fail. – CBroe Aug 19 '16 at 10:57
  • 1
    @CBroe I've written and used several control panels to manage users and, trust me, getting the new user data pre-filled with the username and password of an existing user is just an annoyance. I believe it's an entirely difference scenario than a login form. – Álvaro González Aug 19 '16 at 11:03
  • @ÁlvaroGonzález: _“I believe it's an entirely difference scenario than a login form”_ – ok, I can agree to that. – CBroe Aug 19 '16 at 11:08
  • 1
    One reason to disable it is for when there are text fields before the password field and none of them is a username field. It's a weird case but it does answer the question of why anyone would want to do this. In fact, I have a page on my website that does just this; The page allows me to upload some data to my site but I don't manage users, I just need to make sure some one doesn't accidentally find the hidden page and enter crap. – David Rector Aug 13 '17 at 20:57
  • Some more reasons to want to disable this, for those who need to have it pointed out that there can be many reasons no matter we like the idea or not, are listed in the comments to the supposedly duplicated [question](https://stackoverflow.com/q/2530/2814308). – SantiBailors Apr 03 '18 at 07:30

3 Answers3

1

If it is a new password screen, then this should obviously work

<input type="password" id="confirmPassoword" autocomplete="new-password" />
Mark Perera
  • 652
  • 5
  • 14
  • I wasn't aware of this [(reference here)](https://html.spec.whatwg.org/multipage/forms.html#attr-fe-autocomplete-new-password). – Álvaro González Aug 19 '16 at 11:00
  • This no longer works. It's what I've been using. It stops the password from being auto-filled, but still allows "Use Password For" now. – Regular Jo Mar 10 '18 at 01:43
0

I believe this is built in and dont this can be blocked from chrome. i know the user can disable it but i dont think you can rule it to block it out.

Englishman
  • 51
  • 8
0

I believe there are two ways that Chrome helps users with forms. One is using Autocomplete to pre-populate fields and the other is Autofill which allows you to select items from a dropdown to populate the form.

autocomplete="off" will prevent the first whilst autocomplete="false" will disable both autocomplete and autofill

Hugo Buff
  • 339
  • 4
  • 14
  • 1
    Sorry, but these keywords won't have any effects on famous story of *Autocomplete of Google Chrome* – vivekkupadhyay Aug 19 '16 at 10:50
  • Nope, [only `on` and `off`](https://html.spec.whatwg.org/multipage/forms.html#autofilling-form-controls:-the-autocomplete-attribute:autofill-expectation-mantle-3) make any sense. – Álvaro González Aug 19 '16 at 10:59
  • It seems my info is a little out of date. Oddly `autocomplete="off"` does appear to work on my Chrome 52 – Hugo Buff Aug 19 '16 at 10:59