jQuery UI Autocomplete: Triggering a Search From outside of autocomplete
I would like to trigger some jQuery autocomplete events from outside of auto开发者_如何学Pythoncomplete but I don't know how to. i.e.
$("something").autocomplete({select:function(event,ui){do x},
search:function(event,ui){do y}});
$("something else").keypress(function(eventobject){*trigger autocomplete "select"*});
What code do I put in trigger autocomplete "select"
Use the "Search" method: http://api.jqueryui.com/autocomplete/#method-search
$("something").autocomplete(/* options */);
$("somethingelse").click(function () {
$("something").autocomplete('search', 'demo-value');
});
精彩评论