title: An embeded form in a table and ajax not working properly
body: <p>I have a problem with a form that is inside a table. On its own on it works as it should, posting the values. But I am trying to use ajax to catch the form data. I can only get it to catch the first element. I just don't know if this is even possible</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('form.ajax').on('submit', function() {
    var that = $(this),
      url = that.attr('action'),
      type = that.attr('method'),
      data = {};
  
    // Testing 
    console.log(that);
    console.log(url);
    console.log(type);
    console.log(data);
    console.log(name);
  
    that.find('[name]').each(function(index, value) {
      var that = $(this),
        name = that.attr('name'),
        id = that.attr('id'),
        value = that.val();
      data[name] = value;
      console.log(name);
      console.log(value);
    });
  
    $.ajax({
      url: url,
      type: type,
      data: data,
      success: function(response) {}
  
    });
    return false;
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form id="form1" method="post" action="post.php" class="ajax"&gt;
    &lt;input name="id_1" value="1" /&gt;
  &lt;/form&gt;
  &lt;/td&gt;
  &lt;td&gt;
    &lt;input form="form1" type="text" name="record_1" value="Scooby Doo" /&gt;
  &lt;/td&gt;</code></pre>
  </div>
  </div>
  </p>