title: AngularJS: Submit form the normal way
body: <p>I am implementing AngularJS on an existing web application that requires a common HTTP POST like you would do without AngularJS.</p>
  
  <p>This seems to be more difficult than I expected. The page URL is dynamically generated and cannot be echoed using PHP. I tried modifying the form action using jQuery but that doesn't seem to work either.</p>
  
  <p>Is it really impossible to submit a form the normal way? This is what I mean with a normal form:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form method="post"&gt;
          &lt;input type="text" name="txt"&gt;
          &lt;input type="submit" name="submit"&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And this is the same form with AngularJS:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app&gt;
  &lt;head&gt;
      &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form method="post"&gt;
          &lt;input type="text" name="txt"&gt;
          &lt;input type="submit" name="submit"&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The first form performs a regular form post, the second form doesn't. According to <a href="http://docs.angularjs.org/api/ng.directive:form" rel="nofollow noreferrer">http://docs.angularjs.org/api/ng.directive:form</a> this is by design and I can provide the "action" parameter in the form. Leaving it empty doesn't work and modifying it by using jQuery doesn't seem to work either. </p>