I cannot figure out how to populate the autocomplete list of an input dynamically. Here is some test code:
<input id="AnlNr">
[....]
var AnlNrTags = ["five","six","seven","eight"];
jQuery( "#AnlNr" )
.autocomplete({
source: AnlNrTags,
}
})
.focus(function() {
AnlNrTags = ["one","two","three","four"];
});
Autocomplete populates "five","six","seven","eight". OK. Now when the input is focused, I wanted it "one","two","three","four", but the autocomplete selections are still like before. Seems the autocomplete widget isn't designed to re-evaluate the autocomplete source after initialization.
How can I change my autoselection list in .focus?
Thx
Alina.