I have a textbox where i want to have an autocomplete that lets the user search through addresses. The user must be able to type in different words and the autocomplete must search through them to narrow its list.
I've been trying and reading the documentation, but nothing seems to do the trick as it always searches on the whole string instead of the words. Am i missing something?
Example:
When the user enters 'Mathias Antwerp' he must see all the addresses that contain those words. In the example it must show 1 row which is the second one.
<script>
var addresses = [
{ name: "Frederick Dereave Gentstreet 4 Gent" },
{ name: "Mathias Derian Meilaan 9 Antwerp" },
{ name: "Mathias Hors frelaan 5 Kortrijk" }
];
$(document).ready(SetAutoComplete);
function SetAutoComplete() {
$("#testveld").autocomplete(emails,
{
matchContains: "word"
}
);
}
</script>
<input type="text" id="testveld" style='width:300px'/>