Remove Input Box Drop Down History

Here is a quick tip on how to remove the dropdown history you get with modern browsers.

Normally they are good but if you are designing a form that uses Ajax to give you a drop down list the last thing you want is the browser adding a history.In this example I’m using WordPress and I’ve created an Ajax function for the search box, the problem is the browser keeps displaying a list of recent searches in it’s own drop down box. I don’t want to create my own search form so the answer is to add a small bit of Javascript (jQuery in this case).

jQuery(‘#s’).attr(‘autocomplete’,'off’);

WordPress gives the input box on the search form an ID of “s”

I Hope that helps.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>