title: Onsubmit show success message on div
body: <p>I have 3 forms on a page which i submit by ajax and onsubmit it show a succesful message in a div. the problem is when i click submit on a particualr fomr, it calls all the sucess messages in all the divs. But i want it a particular div to show based on the form that was submitted</p>
  
  <pre><code>&lt;tr&gt;
          &lt;td colspan="3" bgcolor="#FFFFFF"&gt;&lt;div id="comment_div"&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td colspan="3" bgcolor="#FFFFFF"&gt;&lt;div id="love_div"&gt;&lt;/div&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td colspan="3" bgcolor="#FFFFFF"&gt;&lt;div id="favorite_div"&gt;&lt;/div&gt;&lt;/td&gt;
          &lt;/tr&gt;
  &lt;script&gt;
  $(document).ready(function(){
      $("form").on('submit',function(event){
          event.preventDefault();
  
          data = $(this).serialize();
  
          $.ajax({
          type: "POST",
          url: "int_p_cmt.asp",
          data: data
          }).success(function() {
  
              $("#comment_div").append("&lt;div class='comment' style='border:1px purple solid; padding:2px; margin:5px;'&gt;comment!&lt;/div&gt;");
  
              setTimeout(function() { 
                  $(".messages").fadeOut(function(){
                      $(".messages").remove();
                  }); 
              }, 1000);
  
              $("input[type=text]").val("");
  
          });
      });
  });
  &lt;/script&gt;
  
  
  &lt;script&gt;
  $(document).ready(function(){
      $("form").on('submit',function(event){
          event.preventDefault();
  
          data = $(this).serialize();
  
          $.ajax({
          type: "POST",
          url: "insert_call_love.asp",
          data: data
          }).success(function() {
  
              $("#love_div").append("&lt;div class='love' style='border:1px purple solid; padding:2px; margin:5px;'&gt;Love !&lt;/div&gt;");
  
              setTimeout(function() { 
                  $(".messages").fadeOut(function(){
                      $(".messages").remove();
                  }); 
              }, 1000);
  
              $("input[type=text]").val("");
  
          });
      });
  });
  &lt;/script&gt;
  
  &lt;script&gt;
  $(document).ready(function(){
      $("form").on('submit',function(event){
          event.preventDefault();
  
          data = $(this).serialize();
  
          $.ajax({
          type: "POST",
          url: "insert_fav.asp",
          data: data
          }).success(function() {
  
              $("#favorite_div").append("&lt;div class='favorite' style='border:1px purple solid; padding:2px; margin:5px;'&gt;favorites!&lt;/div&gt;");
  
              setTimeout(function() { 
                  $(".messages").fadeOut(function(){
                      $(".messages").remove();
                  }); 
              }, 1000);
  
              $("input[type=text]").val("");
  
          });
      });
  });
  &lt;/script&gt;
  
  &lt;tr&gt;
          &lt;td width="160" bgcolor="#FFFFFF"&gt;&lt;form id="form3" name="form3" method="POST" action="&lt;%=MM_editAction%&gt;"&gt;
            &lt;input type="image" name="imageField2" id="imageField2" src="imgs/buttons/loveit.png" /&gt;
            &lt;label for="textfield"&gt;&lt;/label&gt;
            &lt;input type="text" name="textfield" id="textfield" /&gt;
          &lt;/form&gt;&lt;/td&gt;
          &lt;td width="125" bgcolor="#FFFFFF"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;td bgcolor="#FFFFFF"&gt;&lt;form ACTION="&lt;%=MM_editAction%&gt;" METHOD="POST" id="form5" name="form5"&gt;
            &lt;div align="right"&gt;
              &lt;input type="image" name="imageField" id="imageField" src="imgs/buttons/favorite.png" /&gt;
              &lt;label for="textfield2"&gt;&lt;/label&gt;
              &lt;input type="text" name="textfield2" id="textfield2" /&gt;
            &lt;/div&gt;
          &lt;/form&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td colspan="3"&gt;&lt;form id="form2" name="form2" method="POST" action="&lt;%=MM_editAction%&gt;"&gt;
            &lt;input name="comment" type="text" id="comment" size="50" /&gt;
            &lt;input name="imageField3" type="image" id="imageField3" src="imgs/buttons/comment.png" align="bottom" /&gt;
          &lt;/form&gt;&lt;/td&gt;
        &lt;/tr&gt;
  </code></pre>