title: jQuery change URL of form submit
body: <p>I want to change the URL the form is submitted to upon click as seen below. Below is what I have tried but it does not work.</p>
  
  <pre><code>&lt;form action="" method="post" class="form-horizontal" id="contactsForm" enctype="multipart/form-data"&gt;
    &lt;div class="widget-content"&gt;
  
      &lt;div class="btn-group"&gt;
        &lt;button data-toggle="dropdown" class="btn dropdown-toggle"&gt;  &amp;nbsp;
          &lt;span class="icon-folder-open icon-large"&gt;&lt;/span&gt;
          Move To &lt;span class="caret"&gt;&lt;/span&gt;
        &lt;/button&gt;
        &lt;ul class="dropdown-menu"&gt;
          {% for x,y in actionsForm.fields.move_to.choices %}
          &lt;li&gt;&lt;a class="move_to" id="{{ x }}" href="#"&gt;{{ y }}&lt;/a&gt;&lt;/li&gt;
          {% endfor %}
  
  &lt;script&gt;
      $(document).ready(function() {
          $(".move_to").on("click", function () {
              $('#contactsFrom').attr('action', "/test1");
              $("#contactsFrom").submit();
              e.preventDefault();
          });
      });
  &lt;/script&gt;
  </code></pre>