8

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.

4

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?

| improve this answer | |
  • I don't think the OP wants that behaviour. Plus, you cannot use autocomplete at the field level, it must be at the form level, i.e. <form autocomplete="false"... – DisgruntledGoat Aug 16 '10 at 15:13
  • You can use it on the field level. Check out wachovia.com's login form as a perfect example. – John Conde Aug 16 '10 at 15:22
  • @disgrunt - we use it on field elements all the time - specifically CC number/expiry fields. – Mark Henderson Aug 16 '10 at 21:30
2

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.

| improve this answer | |
2

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.

| improve this answer | |
1

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.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.