[autocomplete] adding element to end of autocomplete list
I am using the
autocomplete plugin on my website and I wanted to add an element to the end of the of the <div/> that contains the autocomplete list, but only if the list is at it's maximum. Basically, I just wanted to let the user know that they can refine their search to get more results.
I have attached a patch of jquery.autocomplete.js where I added my changes. It's probably only a total of about 10 or 15 lines. The diff is from a svn repository, so I'm not 100% confident that it will apply smoothly (I don't know if svn adds some headers that are incompatible with the standard `patch` command). But it should be easy enough to apply by hand.
I also added another css class to jquery.autocomplete.css:
- .ac_additional {
- margin-top: 0;
- text-align: center;
- }
This will be the class applied to the element you specify. You can specify an element in the autocomplete options within your code:
- $("#yourInput").autocomplete("snomedSearch", {
- appendToListElement: $("<p>please refine search terms</p>")
- });