title: Jquery Tagit - How to pass the typed tags back to PHP
body: <p>I'm using the following tagit plugin
  <a href="http://webspirited.com/tagit/" rel="nofollow">http://webspirited.com/tagit/</a></p>
  
  <p>This is the code snippets of the html page that I am trying to test this plugin with - where the user types the tags</p>
  
  <pre><code>&lt;input class="text_field" type="text" size="72" id="question_title"/&gt;
  &lt;textarea id="question"&gt;&lt;/textarea&gt;
  
  &lt;ul id="demo3" class="tagit"&gt;
  &lt;li class="tagit-choice"&gt;apple orange&lt;a class="tagit-close"&gt;x&lt;/a&gt;&lt;/li&gt;
  &lt;li class="tagit-new"&gt;&lt;input class="tagit-input ui-autocomplete-input" type="text" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true"&gt;&lt;/li&gt;
  &lt;ul class="ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all" role="listbox" aria-activedescendant="ui-active-menuitem" style="z-index: 1; top: 0px; left: 0px; display: none;"&gt;&lt;/ul&gt;&lt;/ul&gt;
  
  &lt;input id="question_submit" type="submit" value="Ask Question"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now when the user clicks on "Ask Question" button - the following ajax calls occurs</p>
  
  <pre>
  $("#question_submit").live('click',function(e) {            
          e.preventDefault();     
          var question_val = $("#question").val();
          var question_title = $("#question_title").val();
  
          var tags = $("#demo3").tagit("tags");
          var s ='';
          for (var i in tags)
              s += tags[i].label + " : " + tags[i].value + "\r\n";
          alert(s);
  
              $.post('/course/ask-question', {question: question_val,question_title: question_title,tags:tags}, function(data) {
                  if(data.success=="ok")
                  {
                      $("div#wall").prepend(data.question);
                  }                   
              },"json");
  
      });
  </pre>
  
  <p>So in this function I'm able to get the tags <pre>var tags = $("#demo3").tagit("tags");</pre> and loop through them and print the label and value for each tag.</p>
  
  <p>Now when I try to pass it via the $.post to my PHP controller - it doesn't work - I mean if I remove the data tags:tags when calling the ask-question function it works fine - but when I add it - nothin happens as if the function is not being called.</p>
  
  <p>Is there a particular way to pass this tag object to PHP ?</p>
  
  <p>EDIT
  In Chrome developer tools - when I submit the form while keeping the tags:tags in the data - I'm getting the following error</p>
  
  <pre>
  Uncaught TypeError: Illegal invocation jquery-1.6.4.min.js:4
  e jquery-1.6.4.min.js:4
  bY jquery-1.6.4.min.js:2
  bY jquery-1.6.4.min.js:2
  bY jquery-1.6.4.min.js:2
  bY jquery-1.6.4.min.js:2
  bY jquery-1.6.4.min.js:2
  bY jquery-1.6.4.min.js:2
  bY jquery-1.6.4.min.js:2
  (anonymous function) jquery-1.6.4.min.js:2
  e.extend.each jquery-1.6.4.min.js:2
  bY jquery-1.6.4.min.js:2
  f.extend.param jquery-1.6.4.min.js:4
  f.extend.ajax jquery-1.6.4.min.js:4
  f.(anonymous function) jquery-1.6.4.min.js:4
  (anonymous function) course-feed.js:51
  L jquery-1.6.4.min.js:2
  f.event.handle jquery-1.6.4.min.js:3
  i.handle.k
  </pre>
  
  <p>Appreciate your help
  Thanks</p>