简体   繁体   中英

autocomplete not working in keydown function

I have retrieved data from local database while typing in textbox using keydown function in jquery. I want to show that data's using jquery autocomplete.But autocomplete works fine in onload not in keydown function.

how to do that?

You better read the Autocomplete UI docs. You don't need to attach autocomplete event to keydown, the plugin will do it for you. You just have to invoke Autocomplete on the texbox with the required parameters.

You do not need to manually handle any events when using the jQuery UI autocomplete plugin. That's the point of the plugin.

$('#idOfYourTextbox').autocomplete({
    source: yourDataSource
});

If you're having a more specific problem with the plugin, add that information to your question so we can help you further. If you need more information about the plugin, see the documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM