I am attempting to use the AutoComplete plugin for jQuery UI, specifically the multiple values functionality (with a local array). The goal is an ‘intellisense’ type effect.
The suggestion box appears *ONLY* after you have a comma separating your entires.
For example:
test1, <suggestion list appears>
In my case, I want the suggestion list to appear after a SPACE, instead of a comma, i.e.:
test1<space> <suggestion list appears>
This functionality (or lack thereof) can be seen directly on the demo page linked above, simply type ‘Clojure’, and the box will autocomplete with a comma, then typing another word, such as Java, will then reopen the suggestion list. If you do the same, type Clojure, delete the comma, then press space, suggestions will no longer appear.
I tried to poke into the AutoComplete code but did not see what made this happen – I am not opposed to modifying the actual jQuery UI source itself to make this happen, or use an entirely different plugin system that supports this better.
Any help is appreciated – let me know if you need more detail!
You can change the behavior of the insert by modifying the
selectevent callback. If you click on “view source” on the demo page, you’ll seethis.value = terms.join( ", " );Just change that tothis.value = terms.join( " " );Edit:
You’ll probably also want to edit the
split()function in the demo source code:(Remove the comma)