title: Posting a dynamic jquery array using hidden input element to a php script
body: <p>I have a list box where users can Add, Delete and Update and Save the list. Once clicked on the Save button I am doing a call to the jquery to build the array of elements in the list box and then doing a POST using a hidden INPUT elememt. But I am getting an empty array the PHP POST. Here is the jquery</p>
  
  <pre><code>$("#saveCategory").click (function() {
      var items = $("#jqxlistbox").jqxListBox('getItems');
      var length = items.length; 
      var mylist = new Array();
      for (var i = 0; i &lt; length; i++) {
          var row = {};
          row["cname"] = items[i].value;
          row["cvalue"] = items[i].label;
          mylist[i] = row;
      }
      $("#myCatgories").value(mylist);  
  });
  </code></pre>
  
  <p>here is my html form</p>
  
  <pre><code>&lt;form id="addcategory" method="post" action="index.php"&gt;
  &lt;div style="float: left"&gt;
      &lt;input type="button" value="Add" id="addCategory" style="margin-left: 3px" /&gt;
          &lt;input type="button" value="Update" id="updateCategory" style="margin-left: 3px" /&gt;
          &lt;input type="button" value="Delete" id="deleteCategory" style="margin-left: 3px" /&gt;
          &lt;br /&gt;                                            
          &lt;input type="submit" value="Save" id="saveCategory" style="margin-left: 3px" /&gt;
      &lt;/div&gt;
      &lt;div&gt;
      &lt;input type="hidden" name="myCatgories[]" id="myCatgories" value=""&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p> </p>
  
  <p>Can someone please tell me what I am doing wrong here and put in the right the direction.</p>
  
  <p>Thanks</p>