Guest User

Untitled

a guest
May 26th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
  2.  
  3. <script type="text/javascript">
  4. // we will add our javascript code here
  5.  
  6. $(document).ready(function(){
  7. $("#ajax-contact-form").submit(function(){
  8. var str = $(this).serialize();
  9.  
  10. $.ajax({
  11. type: "POST",
  12. url: "contact.php",
  13. data: str,
  14. success: function(msg){
  15.  
  16. $("#note").ajaxComplete(function(event, request, settings){
  17.  
  18. if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
  19. {
  20. result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
  21. $("#fields").hide();
  22. }
  23. else
  24. {
  25. result = msg;
  26. $("#fields").hide();
  27. }
  28.  
  29. $(this).html(result);
  30.  
  31. });
  32.  
  33. }
  34.  
  35. });
  36.  
  37. return false;
  38.  
  39. });
  40.  
  41. });
  42.  
  43. </script>
Add Comment
Please, Sign In to add comment