title: How to receive form NAME with Ajax post?
body: <p>In my site, I have different pages with different types of form. I want to submit all the forms to 'process.php' using Ajax and process data at 'process.php'. But, I am unable to catch the form name or form submit name at 'process.php' while posting data through Ajax.</p>
  
  <p>Could anyone please tell me how could I know which form has been submitted from 'process.php'?</p>
  
  <p>I tried the following steps that failed:</p>
  
  <p><strong>CHANGE PASSWORD.PHP</strong></p>
  
  <pre><code>&lt;form id="change_password_form" action="process.php" method="POST"&gt;
    &lt;input type="password" id="current_password" name="current_password" /&gt;
    &lt;input type="password" id="new_password" name="new_password" /&gt;
    &lt;input type="password" id="confirm_password" name="confirm_password" /&gt;
    &lt;input type="submit" value="change password" id="submit" name="change_password" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>AJAX.JS</strong></p>
  
  <pre><code>$("#submit").click(function(e){
      e.preventDefault();
      $.ajax({
          url:"process.php",
          type:"POST",
          data:$("#change_password_form").serialize(),
          success: function(data){
              $("#msg").html(data);
          },
      });
  
  });
  </code></pre>
  
  <p><strong>PROCESS.PHP</strong></p>
  
  <pre><code>if(isset($_POST['change_password'])){
      echo("&lt;p&gt;".$_POST['current_password']."&lt;/p&gt;");  
      echo("&lt;p&gt;".$_POST['new_password']."&lt;/p&gt;");  
      echo("&lt;p&gt;".$_POST['confirm_password']."&lt;/p&gt;");  
  }
  </code></pre>
  
  <p>The above code does not echo anything because Ajax did not post <strong>INPUT >TYPE >SUBMIT</strong> .
  Here is what it posted:</p>
  
  <pre><code>Array
  (
      [current_password] =&gt; 12345
      [new_password] =&gt; 123
      [confirm_password] =&gt; 12
  )
  </code></pre>
  
  <p>How would I make Ajax post the input>type>submit ? or else, if I am posting multiple form data to same PHP file for processing, how would I make PHP understand which form has been submitted?</p>
  
  <p>Your reply would be highly appreciated.
  Did I detail too much? My apology is before you.</p>