Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to keep Firefox from putting cached emails and passwords on my registration form?

I have a site with registration & modify account forms. When a user navigates to one of these pages, Firefox is filling in certain areas of the form. It is filling in:

<input type="text" name="nemail2" value="" />

<input type="password" name="npassword" value="" />

Not sure why these names are original for this form, it can be the first time a user ever visits this form and it will fill in their username and password (not even in the correct boxes) from their cached passwords.

Note: the names of the actual login boxes are "emailaddr" and "password", also the <label> is different for these boxes that it is filling in. Not sure what I should do, it looks horrible when a user comes to edit their account information and half optional fields for changing their email/password are filled out with their current information.

Any help is appreciated.

like image 608
Mike L. Avatar asked Jan 07 '11 19:01

Mike L.


1 Answers

Use HTML5's autocomplete="off".

<input type="text" name="nemail2" value="" autocomplete="off" />

<input type="password" name="npassword" value="" autocomplete="off" />

You can also use it in the form element to turn off autocompletion for the entire form.

Source: https://developer.mozilla.org/en/how_to_turn_off_form_autocompletion

like image 135
Adam Avatar answered Oct 28 '22 17:10

Adam