Firefox remembers an invalid username

I have seen similar questions, but nothing that seems to fix the problem I'm experiencing.

I have a registration process in 2 steps. On the first page, you enter the email address, in the second step you enter the password (and other data).

Firefox offers to remember your data, but takes the date of birth as the username (last text field before the password field). The email address is on a hidden page.

Does anyone know how I can tell Firefox that the email address field is a password identifier?

I know that I can use autocomplete = "off", but we still want the user to remember his password, only with the correct values.

Many thanks

+6
source share
3 answers

Make sure the name attributes are different for each input.

Maybe the browser identifies the first entry as a username or some equivalent if there is no better alternative.

EDIT ---

Hm. Well, now I'm shooting a joke, but there is an assumption here: Firefox may not save form values ​​for hidden inputs and look for a replacement instead.

Try this: in the second step, enter the input name as the text input type, not the hidden input type, but hide it with css. Then everything will work better.

+2
source

Problem

Firefox takes the field in front of the password field as your username , regardless of name , id or autocomplete .

Decision

Place the username and password field next to each other.

Disabling autocomplete tells Firefox to forget the form data, but if it is a registration form, Firefox will still ask the user if she wants to save the credentials (stored separately from the form data). For the username, he will always ask to save the field immediately before the password.

+1
source

I also saw this behavior in Chrome (and clients reported it in IE), so this is not just a problem with Firefox. Namely, as Nelu said, the text field that appears before the password field (that is, the field with name = "password") is considered as the login name field, regardless of its name, etc. If there are other form fields that are not β€œtext”, they will be ignored.

For us, the correct solution, apparently, is to not give the field the name "password" if we do not want this automatic behavior of the browser to enter the game.

I think this is an example that the browser is too meager.

+1
source

Source: https://habr.com/ru/post/899781/


All Articles