title: Modify the behavior of jquery tag-it based on autocomplete library to use ajax JSON sources
body: <p>I'm trying to add some functionality to jQuery plugin <a href="http://aehlke.github.com/tag-it/" rel="nofollow">tag-it</a> based on auto-complete :</p>
  
  <p>a) I try to filtering my JSON data to display only name of tag.</p>
  
  <p>A JSON sample returned by <code>/repo/json</code> : </p>
  
  <pre><code>[{id:1, name:"0.8-alpha-1", category:"version"}, {id:2, name:"0.8-alpha-2", category:"version"}, {id:3, name:"0.8-alpha-3", category:"version"}, {id:4, name:"0.8-alpha-4", category:"version"}, {id:5, name:"0.8-alpha-1", category:"version"}, {id:6, name:"0.8-alpha-2", category:"version"}, {id:7, name:"0.8-alpha-3", category:"version"}, {id:8, name:"0.8-alpha-4", category:"version"}]
  </code></pre>
  
  <p>b) I want to submit the id of the tag when user submits data, and not the name.</p>
  
  <p>c) I try to add some constraint to my tag-it input field : user cannot validate a tag which is not in the JSON returned by my <code>/repo/json call</code>.</p>
  
  <p>I don't want to fork tag-it repository, and it seems possible to to test intersection between user array and search with <code>beforeTagAdded</code> option. </p>
  
  <p>I try without success at this time, because I don't know where I can find the list of tags to realize intersection.</p>
  
  <p>My js code : </p>
  
  <pre><code> $(function(){
      $("#singleFieldTags").tagit({
        tagSource: function(search, showChoices) {
          $.ajax({
            url: "/repo/json",
            dataType:   "json",
            data: {q: search.term},
            success: function(choices) {
              showChoices(choices);
            }
          })},
             beforeTagAdded: function(event, ui) {
             //if ($.inArray(ui.tagLabel, search) == -1) {
             //   $("#singleFieldTags").tagit("removeTagByLabel", ui.tagLabel);
             // }
              console.log(ui.tag);
             }});
  
      });
  </code></pre>
  
  <p>The html form : </p>
  
  <pre><code>&lt;form name="data" action="/repo/uploadMole" method="POST" enctype="multipart/form-data"&gt;
      &lt;input name="tags" id="singleFieldTags" &gt;&lt;br/&gt;
      &lt;input type="Submit"&gt;
  &lt;/form&gt;
  </code></pre>