Reputation: 7325
Somehow action is not completed when I choose an item from the menu. Everything else works fine, except again - nothing happens when I select an item.
Here is the code:
<script type="text/javascript">
$(document).ready(function() {
$("#<%=txtSearchTerm.ClientID%>").autocomplete("Acc.ashx", {
formatItem: function(item) { return item.toString().split("#")[0]; },
formatResult: function(item) { return item.toString().split("#")[0]; },
select: function(event, ui) { alert('something'); }
});
});
</script>
Upvotes: 1
Views: 714
Reputation: 7325
I ended up with this working solution
<script type="text/javascript">
$(document).ready(function() {
$("#<%=txtSearchTerm.ClientID%>").autocomplete("Acc.ashx", {
formatItem: function(item) { return item.toString().split("#")[0]; },
formatResult: function(item) { return item.toString().split("#")[0]; }
});
$("#<%=txtSearchTerm.ClientID %>").result( function findValueCallback(event, data, formatted)
{
if(data)
{
$('#<%=hidOID.ClientID %>').val(data[0].toString().split('#')[1]);
}
});
});
</script>
Upvotes: 2