autocomplete - add to local
I'm using autocomplete and referencing a local array. eg.
var foo = new Array("apple","ape");
$("#myinput").autocomplete(foo);
What I'd like to do:
When the user hits a button, if the value in #myinput isn't part of foo, add it.
Then clear the value and the user starts over.
but this time, (this is what I don't know how to do), have the autocomplete use the new foo.
Is there a way to refresh the 'reference' to the local array that autocomplete uses? or add to it?
Many thanks. This plugin rocks.