Thomas Buckley
Thomas Buckley

Reputation: 6056

Firefox 4 autocomplete=off functionality

I have two sites, both under the same domain. I have set autocomplete="off" for a login field in one site (site 1), and not for another site (Site 2).

When I fill out the login field in Site 2, firefox asks me if I would like to remember them and I say yes. I then return to Site 1 and select the down arrow in a login field that I have the autocomplete set to 'off'. It displays the login details I saved in Site 2. I don't want this.

Is there a way to prevent this happening? Is the only option to set autocomplete="off" on all relevant fields in site 2 also?

Thanks

Upvotes: 1

Views: 753

Answers (3)

Kanhu Charan Sahu
Kanhu Charan Sahu

Reputation: 157

Firefox always consider the previous field of a password field as the username field. Thus a possible fix for this is, put a input field between username and password in the login page of site1 and add style="display:none" for the input field. So that the FF will consider the hidden input field as the username field and as the display of the input field is none, the user cannot double click or press down arrow on the filed to get the usernames. This may work for you.

Upvotes: 0

Thomas Buckley
Thomas Buckley

Reputation: 6056

Ok, I set the autocpomplete="off" on Site2's attributes, this made sure the user could not save them and they therefore never show up in site1 now...which is what I want.

Just to clarify - Setting autocomplete="off" simply prevents the browser from saving/remembering the values you entered, it does NOT prevent fields on your getting populated with values you may have saved from another another site that has not got autocomplete implemented on its ownfields.

Upvotes: 0

laurent
laurent

Reputation: 90746

Do you have a "name" or "address" field in your form? In this case, Firefox might ignore the autocomplete attribute. See https://developer.mozilla.org/en/How_to_Turn_Off_Form_Autocompletion#How_to_Turn_Off_the_Autocompletion_Feature

autocomplete is a non-standard attribute introduced by Internet Explorer anyway, so you shouldn't expect it to work everywhere. Personally, I don't like it since it should be up to the user to decide whether they want autocompletion or not.

Upvotes: 2

Related Questions