title: Page is hanging when submitting the form in php
body: <p>I am trying to submit a form using jQuery and ended up hanging the page. I have this one page which have listing and have used table for that. For each listing i am giving edit option. So when user click on edit button on the row, a form will drop below the <code>tr</code> tag and update button. When i click on the update button, page start loading but it keeps loading forever.</p>
  <p>This is my form (Sample), I have <code>foreach</code> for listing, so for each row, we have a new form separated with id.</p>
  <pre><code>&lt;form action=&quot;&quot; class=&quot;edit_form 1&quot; method=&quot;POST&quot;&gt;
      &lt;div class=&quot;row filter-row&quot;&gt;
          &lt;div class=&quot;col-sm-12 col-md-6&quot;&gt;
              &lt;div class=&quot;form-group&quot;&gt;
                  &lt;label class=&quot;focus-label&quot;&gt;Order Id&lt;/label&gt;
                  &lt;input type=&quot;text&quot; name=&quot;order_id&quot; class=&quot;form-control floating order_id&quot; value=&quot;&quot;&gt;
                  &lt;div class=&quot;orderid_error text-danger form_error&quot;&gt;&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;text-center&quot;&gt;
          &lt;button class=&quot;btn btn-primary submit-btn test_update&quot; data-test_id=&quot;1&quot; name=&quot;testupdate&quot; type=&quot;button&quot; value=&quot;test_update&quot;&gt;Update&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  <p>JS</p>
  <pre><code>$(document).on(&quot;click&quot;,&quot;.test_update&quot;,function(){
      var test_id     = $(this).attr(&quot;data-test_id&quot;);
      if(typeof test_id!=&quot;undefined&quot; &amp;&amp; test_id!=&quot;&quot;){
          $(&quot;.edit_form.&quot;+test_id).submit();
      }
  });
  </code></pre>