46

When I generate a text input like this:

<input type="text" name="name" />

When I start to type, the browser will display a dropdown list below the text input. This list contains the values I previously used for this text input in this browser. I want to generate my own autocompletion via ajax.

How do I tell the browser with either css or javascript to not generate this dropdown list.

If this task is easier by using jquery, I would prefer such a solution.

2
  • 1
    input elements aren't dropdown lists. perhaps you're thinking of select elements? I'm sorry, but I don't really understand what you're asking. Commented Sep 25, 2009 at 14:14
  • 1
    I mean the browser generated autocompletion for this text input. Commented Sep 25, 2009 at 14:18

1 Answer 1

60

Both IE and Firefox (maybe others, I didn't research it much) support the autocomplete attribute. If you set it to "off" these browsers will no longer display the autocompletion.

<input type="text" autocomplete="off" />
Sign up to request clarification or add additional context in comments.

4 Comments

Outdated, does not work with newer browsers.
@DamirOlejar Got some data to back that up? caniuse.com/#feat=input-autocomplete-onoff
Confirmed in your link now: browsers are increasingly ignoring or overriding this command, on purpose.
<input type="password" autocomplete="off" /> is not working

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.