Mobile app version of vmapp.org
Login or Join
Ogunnowo487

: Firefox remembering telephone number as username I have a registration page which includes all the standard fields e.g. phone no, email etc. The telephone and password are tab adjacent i.e.

@Ogunnowo487

Posted in: #Browsers #Firefox #Registration #WebDevelopment

I have a registration page which includes all the standard fields e.g. phone no, email etc.

The telephone and password are tab adjacent i.e. not physically adjacent but if you are tabbing it goes first name -> surname -> email -> telephone -> password.

For some reason is giving users a prompt to remember their user name and password when they register (which is nice) but it is saving the telephone number as the username.

Are there rules for helping it decide/stopping it from suggesting people remember the ever so useful telephone number/password combination?

Thanks in advance

EDIT:


The names on the form elements are "Phone" and "txtpassword".
I would like it to remember email and password. Is this achievable given the current situation?
Unfortunately I cannot reorder the form fields. The order is given in the tabbing above.

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Ogunnowo487

4 Comments

Sorted by latest first Latest Oldest Best

 

@Bryan171

You can do something like this:

<input type="text" name="username" autocomplete="username">
<input type="default" name="email" autocomplete="email">
<input type="password" name="password" autocomplete="new-password">


Firefox in the current version looks for the first password field. From there it looks for the first preceding field of type text or email to find the username field.

So we can trick it by using an invalid field type (default is NOT a valid field type). So now you don't need to reorder the fields to satisfy Firefox. When a browser doesn't know the field type it just displays a normal text field.

Safari uses a different mechanism and I haven't had problems with it. I think it looks at the names of the fields.

The autocomplete attributes give the browser further indication about what each field is used for.

10% popularity Vote Up Vote Down


 

@Cofer257

It is generally not possible without reordering your fields or without a hack. Your username field has to be right before your password field in Firefox.

I had the same issue but last name instead of telephone. After hours of trying things this answer made it clear. Firefox (at least in the current version) looks for a password field. Then it takes the field before it as the username field and asks the user if he wants to save these credentials.

Autocomplete is not the (main) issue here. Even with autocomplete turned off for the entire form, Firefox will still ask if you want to save your credentials.

10% popularity Vote Up Vote Down


 

@Yeniel560

I have noticed similar behaviour in Google Chrome before. What are the names given to the input fields? I know that browsers often have problems with fields if they use code like name="signup[email]" to pass everything in one variable to the server side (very useful in PHP).

You could try using this simple format: <input name="username" type="text"> with email and password as the names for those two fields. (Note: I haven't actually tested this, when I came across this situation before I was not able to change the field names.)

10% popularity Vote Up Vote Down


 

@Kevin317

Use autocomplete="off" to disable autocomplete and Firefox (and other browsers who support this non-standard attribute) will not save those values.

<input type=text" name="dontsave" autocomplete="off">


Edit:

What you're seeing may be due to the field names you are using. Auto-complete looks for common username/login field names to work and your telephone number field may be causing Firefox to believe it is the primary login ID field.

Edit 2:

Is the email field before or after the Phone field? If it is after, is it possible to put it before the Phone field? If so, does that make a difference?

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme