title: How to handle multiple forms on same page
body: <p>I have the following HTML:</p>
  
  <pre><code>&lt;form method='post' name='form".$post-&gt;ID."' &gt;
     &lt;input type='submit' name='bid".$post-&gt;ID."' value='Licitar' class='bidvalue'&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And I have the following jQuery <strong>inside a PHP loop</strong> to handle the submit event:</p>
  
  <pre><code>&lt;script&gt;
  jQuery('input[type=submit]').click(function(e) {
      e.preventDefault();
      jQuery.ajax({
          type: 'POST',
          url: ajaxurl,
          data: 'action=newbid&amp;id=".$post-&gt;ID."',
          success: function(msg){
              jQuery('#vehicle-value-box".$post-&gt;ID."').html(msg+',00€');
          }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>When the user clicks on the submit button, I want to update the value of the current bid and update the box with that value with AJAX. I'm doing it in functions.php with:</p>
  
  <pre><code>function newbid_ajax() {
      $post_id = $_POST['id'];
      $mybid = get_post_meta($post_id, 'start_price', true);
      $mybid = $mybid + 100;
      update_post_meta($post_id,'start_price',$mybid);
      die($mybid);
  }
  </code></pre>
  
  <p>However, I can't handle the form submit events <strong>separately</strong>. I have 3 test auctions. When I click on Auction #1, it updates the value of Auction #2; when I click on Auction #2, it updates Auction #3; when I click Auction #3, nothing is updated and e.preventDefault(); doesn't work (the page is reloaded).</p>
  
  <p>You can take a look at the website at this <a href="http://standcardeira.com/leiloes/zona-exclusiva/" rel="nofollow">location</a>. The submit button has the text "LICITAR".</p>
  
  <p>I understand there are other posts out there regarding this problem, but somehow I can't manage to adapt their solutions to my problem.</p>
  
  <p>Thanks in advance.</p>