title: array to send with jquery post
body: <p>Im trying to send a array to my method with <code>$.post()</code> but Im kinda lost how to go about this.</p>
  
  <p>I am getting the values of the checkboxes thats outside my form and pass them into my method.</p>
  
  <p>I tried to use <code>.serializeArray()</code> &amp; <code>.serialize()</code> but get the error that </p>
  
  <blockquote>
    <p>list.serializeArray is not a function </p>
  </blockquote>
  
  <p>I i just send in the array i get null value.
  <br /><br /></p>
  
  <p>HTML</p>
  
  <pre><code>&lt;form....&gt;&lt;input type="submit" value="submit" id="click_post" /&gt;&lt;/form&gt;
  
  &lt;div id="container"&gt;
          &lt;input type="checkbox" value="2,3" name="checkbox" /&gt;
          &lt;input type="checkbox" value="4,5" name="checkbox" /&gt;
          &lt;input type="checkbox" value="6,7" name="checkbox" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JQUERY</p>
  
  <pre><code>$('#click_post').click(function () {
                  var list = new Array();
                  $('#container input[type="checkbox"]').each(function () {
                      list.push($(this).val());
                  });
  
                  var $form = $(this).closest('form');
                  $.post($form.attr('action'), { value: list }, function (data) {
                      alert('test');
                  });
              });
  </code></pre>
  
  <p>METHOD</p>
  
  <pre><code>public ActionResult PassArray(string[] value){//doing some logic here}
  </code></pre>