Christophe Humbert, of Path to SharePoint fame, pinged me yesterday and asked me if I had an autocomplete function in my jQuery Library for SharePoint Web Services. Unfortunately, “no” was the answer, so I decided to build one. Et voila!
There are lots of functions like this one out there available on the Web. I wanted to put one into SPServices which didn’t require anything other than the jQuery library itself. One of the great things about jQuery is the number of plugins and libraries which people are making out there. One of the drawbacks, though, is that they often require *other* plugins to function. Sometimes it’s just the jQueryUI plugin, but I wanted to make my SPAutocomplete function as lean as possible. All you need to use it is jQuery and SPServices.
The SPAutocomplete lets you provide values for a
Single line of text column from values in a SharePoint list. The function is highly configurable and can enhance the user experience with forms. Sometimes a dropdown doesn’t work well, either because of the number of potential values or the type of values it needs to contain. The SPAutocomplete function gives you a different option. Take a look at the demo page to see it in action.
The function is in v0.5.4, which is currently in alpha, but I should be releasing it soon.
Update 2010-04-12: I’ve removed the documentation which had been in this post originally now that the SPAutocomplete function has been released as part of v0.5.4 of SPServices. Please refer to the documentation on Codeplex from now on.