0

I am working on an application where a user has to enter a pincode after logging in. This pincode has to be obfuscated so I have made the input field of type password. However now I have run into the problem that if I click on the input field chrome seems to suggest autocompleting this field with a password via its password manager.

Popup when clicking on the pincode input field

Obviously I don't want to autocomplete the password into a pincode input but I have failed to find a way to stop chrome from suggesting this. I have tried to not make it a password input but instead set text-security myself but this seems less secure/future-proof and I couldn't get that to work on firefox. I've tried giving the input field random id's but this did not stop chrome from suggesting to autofill it with a password.

The actual password field for for credentials and the pincode input field are in two different forms, but on the same url. I assume it's going wrong since the password manager sees two type password fields on the same url, but I'm not really able to change either of these.

How would I go about stopping the password manager from suggesting a password to be autocompleted in a pincode input field?

Edit (why it isn't a dupe): Users have suggested putting a random string in the autocomplete field and I have tried this before but it has not worked nor does it work now unfortunately. I have made an example of the behaviour that I am seeing in JSFiddle (pretty minimalistic but it showcases the problem perfectly). However I can not seem to get chrome to save passwords from snippets so I can't seem to showcase the problem within a snippet. https://jsfiddle.net/mwy6xjbz/2/

How to reproduce problem in the fiddle:

1) Fill in a username and password.

2) Save the username and password via chromes password manager

3) Click on the pin input field (you can even reload the page if you like) and see how chrome suggest filling in the password, despite the input field for the pincode having autocomplete='no-autocomplete-please' nor it being the actual password field.

ApplePearPerson
  • 3,069
  • 3
  • 12
  • 34

1 Answers1

0

add autocomplete="off" attribute inside your tag

like

<input type="password" autocomplete="off" />
Amit Singh
  • 200
  • 1
  • 10