1

First I am not trying to circumvent the browsers auto complete functionality. Happy for auto complete to save and populate a password.

My form contains 3 inputs

  • Quantity
  • Phone number (optional)
  • Password

Currently on submission the quantity or phone number gets saved as the username. Ideally I would save the users email address. However this is not part of the form and I do not wish it to be visible but I can populate it from the server.

How do I go about doing this?

Also happy if chrome just saves the password with no associated username if thats a thing?

Things Ive tried:

Created a hidden empty password input element before the real password input. - No luck

Community
  • 1
  • 1
geda01
  • 11
  • 2
  • Why not just have a standard input field with their email address? – Nathan Merrill Feb 08 '17 at 02:30
  • I dont require the user to re-auth and do not want an additional input field for a user to navigate. However I do want the protection of the password input to prevent accidental transactions (Autocomplete being something a user may choose to disable within the browser). – geda01 Feb 08 '17 at 02:37
  • Did you try checking the `name=""` if they are different? – WTFZane Feb 08 '17 at 02:45
  • Yup all inputs have different names. Im pretty sure Chrome just looks for the input closest to the password field that contains a value and uses that for the username (but I could have this wrong?). Quantity is sometimes being used because the phone number is optional. – geda01 Feb 08 '17 at 02:49
  • If the user is already authenticated, then you don't want chrome to be saving a password. Try [this](http://stackoverflow.com/questions/27280461/prevent-chrome-from-prompting-to-save-password-from-input-box) – Nathan Merrill Feb 08 '17 at 03:44
  • Unfortunately this no longer works. I had tried the hidden input field already(containing the email address with name and id as "username"). I have now just tried the empty email address solution but again chrome has gotten smarter. – geda01 Feb 08 '17 at 03:56

0 Answers0