Firefox remembering telephone number as username

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?


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.


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.