Possible Duplicate:
jQuery AutoComplete Trigger Change Event
I am using jQuery UI v1.9 and I successfully implemented the jQuery UI Autocomplete widget. I would like to know if it is possible to trigger / bind a jQuery UI event and, if so, how to make that. That is, for example, if I have
$('#autocomplete_field" %>').autocomplete({
change: function (event, ui) {
// Make something...
},
minLength: 2,
...
});
is it possible to run the jQuery UI change
event by binding that to a keypress
event?
Note: I tried
$('#autocomplete_field').bind('keypress', function(event) {
$('#autocomplete_field').autocomplete('option', 'change').call();
});
but I get the following error (from the Firebug console):
TypeError: elem.nodeName is undefined
...ks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase(...