Jenny
Jenny

Reputation: 1727

How to disable browser autosuggestion when jquery autocomplete is on?

When I type in an input box, my firefox browser automatically provide suggestions based on whatever I typed in this input box before. With jQuery Autocomplete enabled on this input box, before Autocomplete finish loading its suggestions, browser's suggestion comes first. How can I disable the browser suggestion?

Upvotes: 5

Views: 10122

Answers (4)

Yani
Yani

Reputation: 442

Lately it's better to use autocomplete=nope. Where nope is an invalid value.

With the jQuery (UI) autocomplete plugin you can use the following to change it from off to nope:

$('#Element').autocomplete({
    create: function( event, ui ) {
        $(this).attr('autocomplete', 'nope');
    }
});

Upvotes: 0

Arun Jain
Arun Jain

Reputation: 5464

If you are using HTML5 or normal HTML then you can use the following code:

<input name="username" size="40" autocomplete="off">

Upvotes: 2

Barmar
Barmar

Reputation: 780655

JQuery Autocomplete automatically adds autocomplete=off, you don't need to do this yourself.

Are you using a browser extenstion that overrides autocomplete=off? If so, it will override this.

Upvotes: 3

iamkrillin
iamkrillin

Reputation: 6876

All you have to do is specify autocomplete="off"

<input type="text" value="" id="searchBox" autocomplete="off">

Upvotes: 5

Related Questions