Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable Firefox password manager for some password input fields

I have a registration form and a login form. On login form (my) Firefox by default supplies the username and password, which is ok. On registration form however it does the same - there is no point in this and it makes problems because password field is entered while "repeat password" field is not.

Is there a way I can change registration form's HTML so that Firefox and other browsers will not autocomplete a specific password field?

EDIT: I have found numerous questions (and answers) on this topic, but the proposed solution (setting autocomplete=off on password input field) does not work for me on Firefox (it still autocompletes the field). I have found this solution, but it seems a bit ugly (and doesn't work if user enters the username and hits Tab). Does anyone know of a better way?

like image 396
johndodo Avatar asked Nov 17 '11 07:11

johndodo


1 Answers

Found a simple and elegant solution which should be cross-browser too. Can't believe I didn't think of that - you just add another password input right before your own and then hide it:

<input style="display:none" type="password" name="foilautofill"/>
<input type="password" name="notautofilledpassword" />

Beautiful. :)

like image 112
johndodo Avatar answered Sep 30 '22 16:09

johndodo