title: Array to php via ajax
body: <p>After putzing around some, I have gotten this code to work to show me an alert with the proper array of ids that are checked:</p>
  
  <pre><code>alert($("input[name=our_types]:checked").map(function () {return this.value;}).get().join(","));
  </code></pre>
  
  <p>I need to be able to pass it to the post action function here:</p>
  
  <pre><code>    $.post(action, {
          form_name: $('#form_name').val(),
          site_id: $('#site_id').val()
  
  
      },
  </code></pre>
  
  <p>I've tried doing:</p>
  
  <pre><code>   var our_types = $("input[name=our_types]:checked").map(function () {return this.value;}).get().join(",");
  </code></pre>
  
  <p>And then pass it like this:</p>
  
  <pre><code>    $.post(action, {
          form_name: $('#form_name').val(),
          site_id: $('#site_id').val(),
                      our_types: $('#our_types').val()
  
      },
  </code></pre>
  
  <p>But to no avail. I've been stuck on this for hours, maybe a fresh eye can help.</p>
  
  <p>Heres a working code for another example:</p>
  
  <pre><code>jQuery(document).ready(function(){
  
      $('#contactform').submit(function(){
  
          var action = $(this).attr('action');
  
          $("#message").slideUp(750,function() {
          $('#message').hide();
  
          $('#submit')
              .after('&lt;img src="assets/ajax-loader.gif" class="loader" /&gt;')
              .attr('disabled','disabled');
  
          $.post(action, {
              USERNAME: $('#USERNAME').val(),
              PASSWORD: $('#PASSWORD').val()
          },
              function(data){
                  document.getElementById('message').innerHTML = data;
                  $('#message').slideDown('slow');
                  $('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});
                  $('#submit').removeAttr('disabled');
                  if(data.match('success') != null) $('#contactform').slideUp('slow');
  
              }
          );
  
          });
  
          return false;
  
      });
  
  });
  </code></pre>