April_Nara
April_Nara

Reputation: 1046

Disable Chrome autofill

I am running into issues with Chrome autofill behavior on several forms.

The fields are a standard inputs with name such as 'email', 'firstName' and 'phoneNumber' but if I turn autocomplete="off" then it doesn't populate those fields with the values that I've stored in them and still want populated so I can't do that.

The behavior would be ok except that Chrome is filling the inputs incorrectly, for example when you start typing in the email field firstName options are in the dropdown list to autofill.

Are there any quirks with the autofill behavior that could be used to fix this?

Upvotes: 1

Views: 2774

Answers (3)

Carlene
Carlene

Reputation: 357

Have you tried:

autocomplete="new-password"

At first glance this may look silly but ...

In some cases, 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 forcing the no-autocompletion is to assign a random string to the attribute --- https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion

Upvotes: 0

Yannick Richard
Yannick Richard

Reputation: 1249

weird trick to disable autofill as of may 2015, you can disable it by setting autocomplete="false" instead of autocomplete="off"

This will prevent chrome from autofilling form

Upvotes: 4

A Sharma
A Sharma

Reputation: 656

Refer to Stop Google chrome auto fill the input

Setting value="" prevents this auto-fill behavior.

Upvotes: 1

Related Questions