agarzola / jQueryAutocompletePlugin

Jörn Zaefferer’s (now deprecated) jQuery plugin, with tweaks.
282 stars 151 forks source link

onSelect or onClick #47

Closed vahidhiv closed 9 years ago

vahidhiv commented 9 years ago

Hi, firstable i appreciate your effort on creating this great plugin, i want to add onClick or onSelect event listener on the input which uses autocomplete, is it possible? Would you pls help me? Thank you.

agarzola commented 9 years ago

Hello, @vahidhiv. I appreciate the kind words.

I did not create this plugin. It was created by Jörn Zaefferer. It has since been deprecated in favor of jQuery UI’s Autocomplete. Many years ago, I needed to use features on this deprecated plugin that weren’t easy to do with the new version linked above, so I forked it and added some features to it to fit my needs. However, I haven’t used or maintained it in years, so it’s probably better to use something else.

For your own sake, I strongly suggest you use the more up to date jQuery UI Autocomplete.


Having said all of the above, I don’t see why you couldn’t bind an event handler on the input separately. Like so:

$('#inputID').on('click', someFunction);

Perhaps I’m misunderstanding your request, though.

vahidhiv commented 9 years ago
$('element').result(function(event, data, formatted) {
});

I solved my problem this way, thank you for your attention.