Advertisement
Guest User

Untitled

a guest
Jul 17th, 2012
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.68 KB | None | 0 0
  1. $(document).ready(function(){
  2. $('#my_form').submit( function (e){
  3.         var is_need_submit = false;
  4.         e.preventDefault();
  5.         var str = $(this).serialize();
  6.         $.ajax({
  7.             type: "POST",
  8.             url: "/ajax.php",
  9.             data: str,
  10.             success: function(msg) {
  11.                 $("#my_error").ajaxComplete(function(event, request, settings) {
  12.                     if ( msg == 'OK' ) {
  13.                         is_need_submit = true;
  14.                     }
  15.                     else {
  16.                         $(this).html(msg);
  17.                     }
  18.                 });
  19.             }
  20.         });
  21.         return is_need_submit;
  22.     });
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement