views:

37

answers:

1

This may be really simple, but I'm wondering how browsers that offer a 'remember your password' facility select the 'username' to save?

I'm working with some asp.net that is spitting out it's usual incomprehensible id/name values and the browser is offering to remember the registration form's 'postcode' field as the username, rather than the email address we'd like it to use.

Is the browser looking for a specific 'username' field name/id?
If there is no 'username' then what does it look for next?
Can we specify which field to use?

A: 

HTML does not offer any way for the web authors to support the password management mechanism. Browser basically have to guess which fields hold the username and the password. The latter is a bit easier due to the 'password' input type but not the solution itself, because that input type has no semantic value, it just says how user agents should render those fields.

As far as I can tell you, browsers would simply look for the first password field and then assume that the field before it is the username. So, in your case, you'll have to make sure that the password field strictly follows the username.

Another solution, which I am not sure would help the browsers do the right choice, is to turn off autocompletion on all the fields except the username and the password by setting the autocomplete attribute to off.

Jakub Wieczorek