title: Ajax form submission in Jquery submitHandler is not working
body: <p>I need to validate form with jQuery Validation Plugin and submit data to database without page refresh. All fields in my form are marked as required. However, fields are submitted even if they are empty. Also, page keeps refreshing.</p>
  
  <p>This is my JavaScript code:</p>
  
  <pre><code>    $('#submitButton').click(function() {  
      $("#myForm").validate({
         debug: true,
         rules: {
              name: {
                  required: true
              },
              user_mail: {
                  required: true
              }
         },
         messages:{
             //messages     
         },
         submitHandler(function(form) {
              $.ajax({  
                type: 'POST',
                url: $(this).attr('action'),
                data: $(this).serialize(),
                dataType : 'json',
                success(function(data) {
                  if (data){
                      alert("success");
                      $(this)[0].reset();
                  }
                })
              });
              return false;
          });
    });
  }
  </code></pre>
  
  <p>This is how php looks like</p>
  
  <pre><code>  &lt;?php
  
      function NewUser(){ 
      $fullname = $_POST['name']; 
      $emailaddress = $_POST['user_mail']; 
  
  
      $query = "INSERT INTO my_table (fullName,emailaddress) VALUES ('$fullname','$emailaddress')"; 
      $data = mysql_query($query)or die(mysql_error()); 
      echo json_encode($data);
      } 
  
      if(isset($_POST['submit'])){ 
      NewUser();
      }
  
      ?&gt;
  </code></pre>
  
  <p>This code works well, all data appears in database correctly</p>