I’m referencing the jQuery autocomplete plugin code seen in this tutorial:
http://net.tutsplus.com/tutorials/javascript-ajax/how-to-use-the-jquery-ui-autocomplete-widget/
The problem with this tutorial is that it only support items found on the server. What I would like to do is allow a user to use items found on the server (as it works today) but also to allow user to input new values without the breaking the plugin… Example, so you could enter a user’s email address, press enter, and then continue using the plugin, perhaps then finding another item on the server and again hitting return..
Ideas? Possible?
You could try appending what is being typed in to the list of suggestions. That way they can essentially select what they are typing using “req.term”. Like this:
Then, in the select: function, you could insert the selection into the database with an ajax call if it doesn’t already exists.
Here’s a keypress example for inserting you formated friend on enter: