I am using jquery ui 1.10.3 and jquery 2.0.3. I am trying to use the autocomplete function to change the text of another text field when I select an option from the suggested options from autocomplete.
Below is my code for the autocomplete function. I get the results as needed, but when I select a parameter from it, I get a TypeError: ui.item undefined message.
<script language="javascript"> $(document).ready(function(){ $('#item_code').autocomplete({ source: "http://localhost/test/item/search_item", minLength: 1, select: function( event, ui ) { $( "#item_description" ).val(ui.item.description ); return false; } }).data("ui-autocomplete" )._renderItemData = function( ul, item ) { return $( "<li></li>" ) .data( "item.autocomplete", item ) .append( "<a>" + item.value + " - " + item.description + "</a>" ) .appendTo( ul ); }; }); </script>
I am combing the net, but I came to the moment when I found myself hitting my head on the table. Any help is appreciated.
source share