title: how can I get the result from second code?
body: <p>I have modified my question. How can I get the result from second form? because I have create two form with similar code, however I can only get the result from the first form and when I press the second one, it still get the result from first form. Can someone help me out?</p>
  
  <p>Code</p>
  
  <pre><code>&lt;div&gt;
  &lt;form id="fupForm" name="form1" method="post"&gt;
  &lt;div class="form-group"&gt;
  &lt;input type="hidden" class="form-control" id="gp_name" name="gp_name" 
  value="&lt;?php echo $gp_name;?&gt;"&gt;
  &lt;input type="hidden" class="form-control" id="date" name="date" value="&lt;? 
  php 
  echo $deday;?&gt;"&gt;
  &lt;input type="hidden" class="form-control" id="type" name="type" 
  value="Hotel"&gt;
  &lt;/div&gt;
  &lt;input type="button" name="save" class="btn btn-primary" 
   value="Add Hotel" id="butsave"&gt;
  &lt;/form&gt;&lt;/div&gt;
  
  &lt;div&gt;
  &lt;form id="fupForm2" name="form2" method="post"&gt;
  &lt;div class="form-group"&gt;
  &lt;input type="hidden" class="form-control" id="gp_name" name="gp_name" 
  value="&lt;?php echo $gp_name;?&gt;"&gt;
  &lt;input type="hidden" class="form-control" id="date" name="date" value="&lt;? 
  php 
  echo $deday;?&gt;"&gt;
          &lt;input type="hidden" class="form-control" id="type" name="type" 
  value="Coach"&gt;
  &lt;/div&gt;
  &lt;input type="button" name="save" class="btn btn-primary" 
   value="Add Coach" id="butsave2"&gt;
  &lt;/form&gt;&lt;/div&gt;
  
  &lt;script&gt;
  $(document).ready(function() {
  $('#butsave').on('click', function() {
      $("#butsave").attr("disabled", "disabled");
      var gp_name = $('#gp_name').val();
      var date = $('#date').val();
      var type = $('#type').val();
      if(gp_name!="" &amp;&amp; date!="" &amp;&amp; type!=""){
          $.ajax({
              url: "save.php",
              type: "POST",
              data: {
                  gp_name: gp_name,
                  date: date,
                  type: type              
              },
              cache: false,
              success: function(dataResult){
                  var dataResult = JSON.parse(dataResult);
                  if(dataResult.statusCode==200){
                      $("#butsave").removeAttr("disabled");
                      $('#fupForm').find('input:text').val('');
                      $("#success").show();
                      $('#success').html('Data added successfully !');                        
                  }
                  else if(dataResult.statusCode==201){
                     alert("Error occured !");
                  }
  
              }
          });
      }
      else{
          alert('Please fill all the field !');
      }
  });
  });
  &lt;/script&gt;
  
  &lt;script&gt;
  $(document).ready(function() {
  $('#butsave2').on('click', function() {
      $("#butsave2").attr("disabled", "disabled");
      var gp_name = $('#gp_name').val();
      var date = $('#date').val();
      var type = $('#type').val();
      if(gp_name!="" &amp;&amp; date!="" &amp;&amp; type!=""){
          $.ajax({
              url: "save.php",
              type: "POST",
              data: {
                  gp_name: gp_name,
                  date: date,
                  type: type              
              },
              cache: false,
              success: function(dataResult){
                  var dataResult = JSON.parse(dataResult);
                  if(dataResult.statusCode==200){
                      $("#butsave2").removeAttr("disabled");
                      $('#fupForm2').find('input:text').val('');
                      $("#success").show();
                      $('#success').html('Data added successfully !');                        
                  }
                  else if(dataResult.statusCode==201){
                     alert("Error occured !");
                  }
  
              }
          });
      }
      else{
          alert('Please fill all the field !');
      }
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I have try to find on the Google, but can't find the solution for my case.</p>