Luke Vo
Luke Vo

Reputation: 20748

How to tell browser that the password input is not for account password but is for something else, preferrably not disabling autofill?

I have a website that have login form with username and password and the browser is working correctly to autofill and manage users' passwwords. However, I also have a page like example.com/settings that user should fill in an API Key in an <input type="password" /> (that is not in anyway related to their account password). However, when user submits this API Key, Chrome and Chromium Edge suggests updating their password, which I do not want.

How to tell the browser that a password input is not a form or login? is not relevant because they use autocomplete="new-password" which is what I want to avoid already. Disabling Chrome Autofill using one-time-code completely disables autofill which I probably will use if there is no other option that satisfy my optional requirement. The autocomplete attribute values listed on MDN doesn't give me a good idea of what I should do.

How do I tell browser that this input password should not overwrite their current user's password? If possible, I prefer that the password manager still works and remember this API Key if users wish to but it should be two different entries. I tried setting <input name="api-key" /> but it doesn't work.

Upvotes: 0

Views: 34

Answers (0)

Related Questions