Using an ajax autosuggest script that queries a mysql database as I enter names. As I type in a name with an accent, the dropdown shows different characters than the ones I've typed in. For example as I type in the last name Hylén, the Ajax dropdown shows Hylén. This occurs if the name is not in the database.
$(document).ready(function(){
$("input[id^='last_']").autocomplete('suggest.php',{
matchCase:true,
formatItem: function(data, i, total)
{
var s=data[0].split(",")
return s.join(" ");
}
});
$("input[id^='last_']").result(function(event, data, formatted){
var ids=this.id.split('_')
var id=ids[1]; // from last_xx got xxx
var s=html_entity_decode(data[0]).split(","); // first,middle,last
$(this).next().focus();
$(this).next().select();
//have only last value -- TAB pressed
if(s.length==1)return;
$('#first_'+id).val(s[0]);
$('#middle_'+id).val(s[1]);
$('#last_'+id).val(s[2]);
});
});
What should I be looking at to fix this?