2

As seen in the screenshot - how can one disable autofill when using typeahead ?

Thank you.

PS:

browser used is Chrome Version 47.0.2526.106 (64-bit)

RomanT
  • 21
  • 1
  • 4

4 Answers4

2

Add autocomplete="unique-field-name" and make sure the field has a name="unique-name" attribute.

For me, using 63.0.3239.132 Chrome, with 0.11.1 Typeahead.js, this was the only way to reliably stop Google Chrome autofilling my typeahead. (Typeahead seems to copy over autocomplete="off" but that seems to be being ignored by Chrome currently.)

Woody Hayday
  • 97
  • 1
  • 5
2

Use:

<input type="search" autocomplete="off">

Works on Chrome: Version 65.0.3325.162 (Official Build) (64-bit)

Agustin
  • 31
  • 4
  • Yes! This works in old school asp.net: `TextBox.Attributes["type"] = "search"; TextBox.Attributes["autocomplete"] = "off";` – EJC Jan 16 '19 at 15:58
1

Just add autocomplete="off" Attribute to your input field:

http://www.w3schools.com/tags/att_input_autocomplete.asp

Best Wishes

winston
  • 511
  • 4
  • 9
  • Hi @winston. Thank you. Unfortunately I've already tried that pearl, and it didn't affect the effect. – RomanT Jan 19 '16 at 13:16
  • Sorry to hear that! have you taken a look into [this](http://stackoverflow.com/questions/25228951/autocomplete-off-not-working-for-google-chrome) and/or [this](http://stackoverflow.com/questions/15738259/disabling-chrome-autofill/29582380#29582380) thread? – winston Jan 20 '16 at 14:04
  • You saved my day, winston. Thank you. – Jonas T Jul 04 '17 at 23:52
  • Unfortunately this approach no longer works as modern browsers ignore it – Chris Denning Feb 14 '18 at 12:11
0

If using jQuery, once you have initialised the typeahead binding on the control in your js, just add some additional code to set the autocomplete attribute to 'new-password'.

$('#typeahead-field').attr("autocomplete", "new-password");

This works as of Chrome Version 81.0.4044.138 (May 2020)

Greg Quinn
  • 1,927
  • 1
  • 23
  • 26