title: Change form action based on submit button
body: <p>I have many forms like the following on the page. Now I want change the form action based on which submit button the user clicked (and of course submit the form)</p>
  
  <pre><code>&lt;form action="/shop/products.php" data-ajax="false" method="post"&gt;
      &lt;div data-role="fieldcontain"&gt;
  
          &lt;input name="submit" class="obutn" type="submit" value="Order" /&gt;
          &lt;input name="submit" class="oEbutn" type="submit" value="Extras" /&gt;
  
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I tried with</p>
  
  <pre><code>$(".obtn").click(function() {
      $(this).parent().parent().attr("action", "/shop/products.php");     
  });
  $(".oEbtn").click(function() {
      $(this).parent().parent().attr("action", "/shop/extras.php");       
  });
  </code></pre>
  
  <p>but the form is always submited to products.php. Can you tell me what's wrong?</p>