Possible Duplicate:
Trying to get tag-it to work with an AJAX call
How can I get tags from the database for autocomplete.
I thing I can handle the php part by myself 🙂
This is the minimal code for the autocomplete feature and I really don’t get it how to post the tag to php.
$(function(){
$('#tags').tagit({
availableTags: ['c++', 'java', 'php', 'coldfusion', 'javascript', 'asp', 'ruby', 'python', 'c', 'scala', 'groovy', 'haskell', 'perl', 'erlang', 'apl', 'cobol', 'go', 'lua']
});
});
you can find the full code here:
http://aehlke.github.com/tag-it/css/jquery.tagit.css
Do you want to fill in availableTags variable with available tags from the database?
You can simply do
between
[and]Or you can of course get your data with
$.ajax()or$.get()For example:
In case you are doing autocomplete, you can have your PHP script respond with available tags by given entry, for example:
On the JavaScript part you would invoke on each keypress a call similar to this: