3 ms·
The problem is simple: what is a login form? Browsers detect the login form from the presence of password fields and sometimes an email field. If you ever have
by tacone 10y ago
The problem is simple: what is a login form? Browsers detect the login form from the presence of password fields and sometimes an email field. If you ever have an admin form were you can change the password of a user, you will get the autocomplete everytime, no matter what you do. You have to resort to JS. Also there are situations where you just don't want to give your users the choice (bank apps etc).
- timv 10y agoThis! I have previously wasted so much time working around this browser behaviour. The trick I use now is to add in a hidden (via CSS) pair on inputs earlier on the page, that do nothing. The browser fills those in, and leaves the real password admin fields empty.
- zimpenfish 10y agoI might be missing something subtle or obvious but can't you just give the inputs different names? Is it such a trauma to handle that case in the backend? e.g. <input name='admin-user'><input name='admin-pass'>? (Now if Chrome is auto{fill,complet}ing those with usernames + passwords, that's definitely a disastrous bug.)
- timv 10y agoNow if Chrome is auto{fill,complet}ing those with usernames + passwords, that's definitely a disastrous bug You say "bug", they say "works as designed".
- tacone 10y agoInteresting trick.