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.<!--more-->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.

Post your comment

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments

Copywrite © 2017 Kevin Phillips All rights are reserved.

Proudly supporting opensource software