$(function() {
var availableTags = ["ActionScript", "AppleScript", "Scheme"];
$("#tags").autocomplete({
source: availableTags
});
I don want the values inside the tags. i have a JS page i need to make a function for connecting my DB to the auto complete plugin. How can i do it suggestions Please.
Thanks in Advance..
You can not connect to a database using only JavaScript and you should never show your database values in JavaScript as everybody can read them.
You have to use a server side script to connect to your database, resolving the autocomplete values and responding them to the autocomplete plugin.
So in gerenal you don’t use a local “source” with the suggestions, but a server side script and getting the values through ajax calls:
EDIT: So i looks like it is a JSP page. After getting the values wihtin the function, you have to create an output (and use the “reponse” to send it to the client) with each value in a new line looking like this:
You can even use HTML to markup the match of the query string (let’s asume it was “Sc”):