2

Is it possible to turn off autofill in forms into Google Chrome? I tried do it in that way:

autocomplete="new-password"

but it doesn't work. Only change id and name of input to phrase: "password" is solve this problem but my script is very large and use this params (id and name) in many places so I can't change this params.

I know, there were many threads about this problem but I checked everything what I found here and into Google and nothing help me.

Can I do it using javascript or CSS? Maybe anyone has other solution for this problem?

Thanks.

Pavlo K
  • 141
  • 8
  • Duplicated question [How do you disable browser Autocomplete on web form field / input tag?](https://stackoverflow.com/questions/2530/how-do-you-disable-browser-autocomplete-on-web-form-field-input-tag) – osiris85 Nov 08 '18 at 09:59
  • @osiris85 I checked this theard and can you tell me where is solution into this theard for this problem?? I can't see it... – Pavlo K Nov 08 '18 at 10:02
  • on responses, it's indicate that not are solution, all input type password allow to user save the password on local if you need make an input that not allows it you need use other input type and encrypt on code. – osiris85 Nov 08 '18 at 10:06
  • I need to do it into text input, now password input. I just wanna to full-disable autofill and it work in all browsers without Google Chrome... Here is my input: `` – Pavlo K Nov 08 '18 at 10:08
  • please review next link https://stackoverflow.com/questions/10938891/disable-form-autofill-in-chrome-without-disabling-autocomplete – osiris85 Nov 08 '18 at 10:15
  • @osiris85 I wrote about it into first post - `autocomplete="new-password"` is doesn't work too. – Pavlo K Nov 08 '18 at 19:43
  • On other response they Talk create two type password (one hidden( – osiris85 Nov 08 '18 at 19:50
  • After Chrome version 72.XX, this fix does not work. Find the lastest fix here https://stackoverflow.com/a/55045439/1161998 – Adheep Mohamed Abdul Kader Mar 07 '19 at 15:11

3 Answers3

1

The issue is that Chrome thinks they know better than you about how autocomplete should function in your site.

All the major browser are deciding to ignore the autocomplete=off STANDARD (and yes, it is a standard). I have a proposal - make allowing a site to disable autocomplete a permission that is granted to the site by the user, just like accessing the user's location. Please go to the Chromium board

https://bugs.chromium.org/p/chromium/issues/detail?id=914451

and comment to that effect. The browser makers aren't changing their decision to ignore the standards, but developers and users need a way off this path when this behavior on a particular site is utterly harmful to the user experience.

BDH
  • 11
  • 1
-1

You can have a look here:

Just turn the autocomplete attribute to "off".

autocomplete="off"

You can do this either for an entire form, or for specific input elements in a form:

<form method="post" action="/form" autocomplete="off">
[…]
</form>

<form method="post" action="/form">
  […]
  <div>
    <label for="cc">Credit card:</label>
    <input type="text" id="cc" name="cc" autocomplete="off">
  </div>
</form>

UPDATE; Its been noted that sometimes Google Chrome ignores the above solution, thus as far as i can see, javascript is the best solution as noted here:

(function() {
    var some_id = document.getElementById('some_id');
    some_id.type = 'text';
    some_id.removeAttribute('autocomplete');
})();
Nelson Owalo
  • 1,954
  • 15
  • 31
  • 1
    It doesn't work into Google Chrome... I do it as first and it works in all browsers without Google Chrome. – Pavlo K Nov 08 '18 at 10:09
-2

To turn off autocomplete in your form, simply do: autocomplete="off", see here.

<form action="/MyAction" method="get" autocomplete="off">
  First name:<input type="text" name="fname"><br>
  <input type="submit">
</form>

To turn off autocomplete on your input:

<input autocomplete="off">
Hooman Bahreini
  • 11,018
  • 7
  • 41
  • 74