title: jQuery .submit() - No Response
body: <p>I am Unable to submit a form using jQuery <code>.submit()</code> function. On my website, I have: </p>
  
  <ol>
  <li>index.php</li>
  <li>view-detail.php</li>
  <li>form-process.php</li>
  </ol>
  
  <p>On <code>index.php</code> page, is a list of records that user can click to view full details of the records. </p>
  
  <p>The <code>view-detail.php</code> page show the record details and also a form if user want to update the status approval.</p>
  
  <p><code>form-process.php</code> will be the form processing for update record</p>
  
  <blockquote>
    <p><strong>Codes</strong></p>
  </blockquote>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;script&gt;
      jQuery(document).ready(function($){     
          function myForm(e){
              e.preventDefault();
              var data = $(this).serialize();
              alert(data);
              $.ajax({
                  type: "POST",
                  url: 'form-process.php',
                  data: data,
                  success: function(response) {
                      alert("success");
                      console.log(response);
                  },
                  error: function() {
                      alert('Error Submitting');
                  }
              })
          }
  
          $(".view_detail").click(function(e){
              e.preventDefault();
              url = $(this).attr('href');
  
              $.get(url, function(data){
                  $("#section").html(data);
                  $("form").submit(myForm);    
              });
          });
  
      });
  &lt;/script&gt;
  
  &lt;div id="section"&gt; 
     &lt;!-- records from db and link to view full detail --&gt;
     &lt;a href="view-detail.php?id='.$permohonan_id.'" class="view_detail"&gt;View&lt;/a&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p><strong>view-detail.php</strong></p>
  
  <pre><code>&lt;form id="myForm" name="kelulusan" action="&lt;?php echo 'form-process.php'; ?&gt;" method="post"&gt;
      &lt;div class="sokongan"&gt;
          &lt;input type="radio" name="kelulusan" id="dp" value="Dalam Proses"&gt; Dalam Proses&lt;br&gt;
          &lt;input type="radio" name="kelulusan" id="ll" value="Lulus"&gt; Lulus&lt;br&gt;
          &lt;input type="radio" name="kelulusan" id="tl" value="Tidak Lulus"&gt; Tidak Lulus 
      &lt;/div&gt;
      &lt;p&gt;&lt;input type="hidden" name="pid"  value="&lt;?php echo $pid;?&gt;"&gt;&lt;/p&gt;
      &lt;input type="submit" name="submit"  value="Submit"&gt; 
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>form-process.php</strong></p>
  
  <pre><code>&lt;?php
  if(isset($_POST['kelulusan'])){
      $status = $_POST['kelulusan'];
      echo "Update : $status ";
  }
  // validate and update database query
  ?&gt;
  </code></pre>
  
  <p>When I click on the submit button, there is response from the form. May I know why and how to resolve it? </p>