Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Prevent Chrome from warning about a missing autocomplete attribute

In my app I have a "change password" form which requires a user to enter their current password and their new password (twice).

The purpose of entering the current password is a security measure, e.g. if a user steps away from their desk, it prevents someone else from changing their password and gaining control of their account.

For this reason, I absolutely do not want this field to be autocompleted. However, if I don’t specify an autocomplete attribute, I get the following warning in Chrome’s dev console

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

[DOM] Input elements should have autocomplete attributes (suggested: "current-password"): (More info: https://www.chromium.org/developers/design-documents/create-amazing-password-forms/) <input id=​"current-password" type=​"password">​

If I add an attribute autocomplete="current-password" the warning no longer appears, but the field is filled automatically with the user’s current password, which defeats the very purpose of this field.

How can I prevent this field from being filled automatically without getting a warning in the Chrome console?

>Solution :

You could use the value off in the autocomplete attribute.
For example: autocomplete="off"

Read more about it on MDN Web Docs.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading