开发者

Preventing the browser's autosuggest when using an autocompleter with jQuery

开发者 https://www.devze.com 2023-02-28 03:18 出处:网络
I\'m using a small autocompleter function with jQuery. That works well. The problem is that when I\'m typing a text in the input, my browser suggests me some of the previous texts I\'ve typed before

I'm using a small autocompleter function with jQuery.

That works well.

The problem is that when I'm typing a text in the input, my browser suggests me some of the previous texts I've typed before.

That part covers up the first answer of my autocompleter lookup function...

Here is a snapshot of t开发者_高级运维he problem (the box where "lemp" appears) :

bug_autosuggest.jpg

Is there a way to disable this behaviour ?

I mean "without going in the client-side settings of the browser".

Thanks for your help.


Just set the autocomplete attribute to "off" on your input elements, or on your form element itself.

<form action="?" method="post" autocomplete = "off">
   ...
</form>

Source.

You may want to add it with jQuery.

0

精彩评论

暂无评论...
验证码 换一张
取 消