18

Is there some way I can stop Chrome from auto populating input boxes? I have a page with a Sign Up form and a Log In form. In Chrome, if a user has already signed up and they've come to this page to log in, the password input box on the sign up form is populated with their password. I would really like to force the sign up fields to never auto complete.

I've tried setting autocomplete="false" but this makes no difference.

thor
  • 1,318
  • 2
  • 15
  • 24
  • 1
    If the autocomplete answers below won't work, try something like value=" " (setting an empty string as default value). Even plugins/addons in chrome will not overwrite existing data in an input field. – favo Jun 08 '10 at 17:21

2 Answers2

23

autocomplete="off" worked on our site.

Jim B
  • 8,344
  • 10
  • 49
  • 77
  • For reference (HTML5 Draft Spec - autocomplete): http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#attr-form-autocomplete, and it looks to be (at least partially) supported in most modern browsers. – Rich Adams Jun 08 '10 at 17:27
  • That's in accordance with the documentation of this non-standard (until HTML5) attribute: "Any string other than off enables AutoComplete" according to MSDN http://msdn.microsoft.com/en-gb/library/ms533486(VS.85).aspx , the WebKit docs https://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#//apple_ref/doc/uid/TP40008058-autocomplete and the Mozilla docs https://developer.mozilla.org/en/HTML/Element/Input#Attributes – NickFitz Jun 08 '10 at 17:36
  • and autocomplete="off" works perfectly on ours now too! Thanks for that. I was sure I read that the attribute had true/false states.. Obviously I was wrong. – thor Jun 08 '10 at 18:04
  • 1
    This solution does not work on modern browsers. Chrome just ignores "autocomplete" attribute. – Yuvraj Patil Aug 02 '17 at 10:43
0

You could simply use different field names.

Tgr
  • 27,442
  • 12
  • 81
  • 118
  • 2
    There is no guarantee this would work, and really I shouldn't have to refactor my form/dependencies to avoid it. In my case Chrome is autocompleting my username in a confirm email field with the name "registration_form[email][second]". I'm not sure what I would even change it to in order to prevent this behavior. Chrome is autocompleting a field with a value that doesn't even meet the html5 input type=email requirements. It overlooks the input with "_username" in the name, and then skips the first email input box to autofill the second confirmation input box. – Marcus Pope Mar 26 '13 at 15:11
  • 1
    Confirmed today this does not work with recent browsers. They quite happily attach to the first `type="text"` that comes before the first `type="password"` field. – iCollect.it Ltd Aug 26 '16 at 14:36