title: Trying to change action in form
body: <p>I have an issue that I have not run into on any other web form before. I am trying to change the action of an html form. I am using jquery to change the action based on whatever button is pressed. In this example, assume the update button has been clicked. The issue I get is after the form is submitted, the jquery just adds the action to the end of the URL instead of replacing the original action Below is some code and the URL result of what I am seeing:</p>
  
  <p><strong>Jquery:</strong></p>
  
  <pre><code>$(document).ready(function () {
    $('#itemUpdateBtn').click(function () {
      var modal = $('#Modal');
      $('#modalForm').attr('action', 'Update');
      modal.modal();
    });
  });
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>@using (Html.BeginForm(null, "Inventory", FormMethod.Post, new { @id = "modalForm"})){}
  </code></pre>
  
  <p><strong>URL Result</strong></p>
  
  <pre><code>localhost:80000/Inventory/Details/Update
  </code></pre>
  
  <p><strong>Expected URL Result</strong></p>
  
  <pre><code>localhost:63928/Inventory/Update
  </code></pre>
  
  <p>Some information:</p>
  
  <ul>
  <li>Form resides on the Details page</li>
  <li>Form is in modal</li>
  <li>I do not have issues on other pages that are set up in a similar fashion.</li>
  </ul>
  
  <p>Any help will be greatly appreciated. Thanks!</p>