I have next function for autocomplete an input:
$("#auto").autocomplete({
source:"/autocomplete.php",
minLength: 5,
_renderItem: function( ul, item) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( $( "<a></a>" ).text( item.label ) )
.appendTo( ul );
}
});
The JSON array contains 3 parameters ( value , label , extra ). How could I grab the third parameter and append it to another input text right after an element from autocomplete list has been selected?
Use the select event.
The event handler gets passed two parameters:
uiobject which contains the data of the selected item inui.itemExample:
BTW, the way you try to override the
_renderItemmethod is not correct, it should be: