AutoComplete writes search result to input and at bottom of page
Hi guys
I'm new to jQuery UI and I'm seeing a strange result. For some reason the autocomplete works exactly as expected, except that in addition to populating the appropriate text box with search results, I also get the selected line at the bottom of the page. I end up with this appended (red rectangle bottom left):
Here's my code. Any ideas?
$( document ).ready(function() {
console.log("loaded");
var myData = [];
var requestHeaders = {
"accept": "application/json;odata=verbose"
}
$.support.cors = true;
$.ajax({
method: 'GET',
dataType: 'json',
async: false,
headers: requestHeaders,
success: function (data) {
$.each(data.d.results, function (i, result) {
myData.push(result.ID + ": " + result.Title);
});
myDataSource(myData);
},
error: function ajaxError(response) {
alert(response.status + ' ' + response.statusText);
}
});
function myDataSource(myData){
$(" #txtSearchProj ").autocomplete({
source: myData,
minLength: 1,
delay: 500
});
}
});