I’m using the following code to search an ajax file for a query with the autocomplete plugin:
$("input.search_bar").autocomplete("/autocomplete/", {
scrollHeight: 300,
minChars: 3
});
The search results are HTML encoded names like:
Bob’s Store (really Bob%39s Store)
Bill’s Shop (really Bill%39s Shop)
etc…
The autocomplete dropdown shows the correct HTML like so:
Bob’s Store
Bill’s Shop
But when I select one of the results and the result moves into the input field, the input field displays the escaped value like so:
Bob%39s Store
How do I use the jQuery Autocomplete plugin to format the result to show the unescaped value when a result is chosen?
I’ve tried the following plugin function without any luck:
$("input.search_bar").autocomplete("/autocomplete/", {
scrollHeight: 300,
minChars: 3,
formatResult: function(row) {
return unescape(row);
}
});
try this code,