RomanT
RomanT

Reputation: 21

Disable browser's autofill when using typeahead.js

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)

Upvotes: 2

Views: 4123

Answers (4)

Greg Quinn
Greg Quinn

Reputation: 2178

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)

Upvotes: 0

Agustin
Agustin

Reputation: 31

Use:

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

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

Upvotes: 2

Woody Hayday
Woody Hayday

Reputation: 127

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.)

Upvotes: 2

winston
winston

Reputation: 549

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

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

Best Wishes

Upvotes: 1

Related Questions