ret += accentMap[ term.charAt(i) ] || term.charAt(i);
}
return ret;
};
$( "#developer" ).autocomplete({
source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
response( $.grep( names, function( value ) {
value = value.label || value.value || value;
return matcher.test( value ) || matcher.test( normalize( value ) );
}) );
}
});
});
</script>
</head>
<body>
<divclass="demo">
<divclass="ui-widget">
<form>
<labelfor="developer">Developer: </label>
<inputid="developer"/>
</form>
</div>
</div><!-- End demo -->
<divclass="demo-description">
<p>
The autocomplete field uses a custom source option which will match results that have accented characters even when the text field doesn't contain accented characters. However if the you type in accented characters in the text field it is smart enough not to show results that aren't accented.
</p>
<p>
Try typing "Jo" to see "John" and "Jörn", then type "Jö" to see only "Jörn".