dreampowder
dreampowder

Reputation: 1653

Cannot get tag list from Jquery TAGIT

hi there i am woring with java play framework and i want to implement JQuery Tagit in my project.

I am doing exactly the same thing written in their site but i cant manage to retrieve the values of selected values. heres the code:

<form id="messageForm">
<script>
$(document).ready(function(){
    $("#mytags").tagit({
        select:true,
        availableTags:function( request, response){
            $.ajax({
                url: "@{Users.getUserList()}",
                dataType: "json",
                data: {
                    term: request.term
                },
                success: function( data ){
                    response ($.map( data, function ( item){
                        return {
                            label: item.fullName,
                            value: item.username
                        }
                    }));
                }
            });
        }
    });
});
</script>
<label for="mytags">To:</label>
<ul id="mytags" name="selectedTags"></ul>
</form>

i can succesfully populate the list with json elements, i have no problems with that. but somehow i cant manage to retrieve the entered tags from it.

i tried

document.getElementByID("messageform").selectedTags

but i think im doing it wrong.

Upvotes: 2

Views: 838

Answers (1)

dreampowder
dreampowder

Reputation: 1653

Finally i found the problem. Tag-it plugin is a quite common plugin but there are lots of different version written by different programmers around the internet. I was working with a different tag-it module than i was looking at the document. So be careful that you are reading the corrent document of the tagit module you are using (sorry for my grammar i know it sucks) –

Upvotes: 1

Related Questions