Question

How to hide a text input's browser-generated dropdown list of previous items

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.

 45  34953  45
1 Jan 1970

Solution

 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" />
2009-09-25