0

I have several places in my web app that allows the end user to create new users. However if the user upon logging in the first times opt to have chrome/Firefox save there credentials it will from then on our put there login password in the <input type="password"> fields. This is not a problem with autocomplete with is a problem with the browsers native function to save end user login information then try to populate input fields for the user.

Is there a way to over ride this.

Charles L.
  • 1,625
  • 2
  • 24
  • 44
  • possible duplicate? http://stackoverflow.com/questions/38144955/how-to-disable-saved-password-features-of-browsers-on-add-users-form Kinda hacky, but seems to do the trick. – Kevin B Dec 19 '16 at 21:53
  • @KevinB this is a very hacky way of doing this. My web application is far to large and complicated to throw something like this in and hope nothing happens – Charles L. Dec 19 '16 at 21:59
  • well... there's also the point here in that you really shouldn't be allowing users to set other user's passwords... If you omitted the password field, does it still autofill the username? – Kevin B Dec 19 '16 at 22:06
  • @KevinB not in this case :) – Charles L. Dec 19 '16 at 22:07
  • @KevinB the browser looks for an input field type="password" and then tries to auto fill as much information as it can, in this case an email as well. – Charles L. Dec 19 '16 at 22:08

1 Answers1

0

Duplicate of This question.

Simply create a couple of fields and make them hidden with "display:none".

Example:

<!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
<input style="display:none" type="text" name="fakeusernameremembered"/>
<input style="display:none" type="password" name="fakepasswordremembered"/>

Then put your real fields underneath.

Community
  • 1
  • 1
Haim Houri
  • 259
  • 1
  • 11