mpen mpen - 1 year ago 70
jQuery Question

How to get jQuery Autocomplete to pop up on field focus?

Possible Duplicate:

jQuery autocomplete UI- I'd like it to start the search onfocus without the user having to type anything

jQuery UI Autocomplete

I want the options to appear as soon as my input is focused. Is there a setting for that? I tried setting minLength to 0, but it doesn't work... it still waits for a keypress.

Answer Source
$("#yourField").bind('focus', function(){ $(this).autocomplete("search"); } );

Here a jsfiddle: Updated one (for IE):

As enlighted by @HoldOffHunger you must also set minLength to 0

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download