0

I have a registration and user login form on a website I'm working on. The registration form includes fields for "First name" and "Last name".

Suddenly I'm told by my boss that when he tried to register again to the website, the form is auto-filled with the wrong values, i.e. a mix-up where his first name is filled in with his family.

Is this something I should be worried about? Isn't this something specific to my boss's form-filling history on his specific browser, where he must have made a mistake?

But how do these things work? Is there anyway I can ensure that the browser knows the user's first name and last name through other form-filling history and fills in the right details?

user961627
  • 12,379
  • 42
  • 136
  • 210
  • 2
    Without any code, you are only going to get guesses. If you have not put code in to populate the form with data, then it is the browser remembering form history and pre-filling the form with data that has been previously entered in forms with those field names. – Anigel Jun 11 '13 at 11:07

1 Answers1

1

Is this something I should be worried about? Isn't this something specific to my boss's form-filling history on his specific browser, where he must have made a mistake?

Probably, and probably.

But how do these things work?

This is done by the browser's form filler when the latter is enabled.

Is there anyway I can ensure that the browser knows the user's first name and last name through other form-filling history and fills in the right details?

Yes. Use names that make sense consistently, e.g. a field named email will prompt the browser to fill in the email. If you use a field called name, instead of e.g. firstname or lastname you're subjected to it getting filled up with either.

I'm unaware of any place that documents precisely what each browser vendor looks for specifically. There is, however, an attribute that may help you: autocomplete='off'.

See this related question, too: Is there a W3C valid way to disable autocomplete in a HTML form?

Community
  • 1
  • 1
Denis de Bernardy
  • 75,850
  • 13
  • 131
  • 154