I'm using jQuery 1.8 Autocomplete.
Is there any way of getting the selected object outside of one of the event handlers?
I'm trying to do something like...
$("#searchUsers").autocomplete({
source: 'Users/List',
});
$("#addUser").click(function() {
// get the selected user Id
var item = $("#searchUsers").autocomplete('selected');
alert(item.Id);
});
I can't see any way of doing it but it seems a pretty obvious requirement.
$("#searchUsers").val()give what you want?