title: Sending input array values by POST to php
body: <p>I am trying to read the values of an input array and pass them to my backend PHP, but am not able to get this working.
  I have the following html:</p>
  
  <pre><code>&lt;input name='field[]' class='myclass' value='test1'&gt;
  &lt;input name='field[]' class='myclass' value='test2'&gt;
  &lt;input name='field[]' class='myclass' value='test3'&gt;
  
  &lt;input id='post_this_val' type='button' value='Post'&gt;
  </code></pre>
  
  <p>I want to read these values in jQuery and POST the values to my backend PHP, which will then process the results. This is what I do:</p>
  
  <pre><code>$('#post_this_val').live('click', function () {
      var inpVal = $('input.myclass').map(function(i, el) {
                              return el.value;
                      });
      $.post('/my/php/function', {data: inpVal});
  });
  </code></pre>
  
  <p>The above POST is not working- my php function is not even getting called and the page simply reloads on clicking the POST button. Suggestions please.</p>