title: jquery ajax contact form redirects to contact.php instead of catching php echo and executing sucess function
body: <p>I have a contact form php+jquery+HTML.the form div is hidden in index.HTML,until contact button is presses.Jquery works,Ajax call posts needed data to php,which echoes a response.The problem is when php echoes,instead of remaining on same page without refreshing,browser redirects to contact.php,where the echo is showed correctly.I think the Ajax part won't catch the response from server,although syntax is the same in all tutorials.please assist.
  html part:</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id = 'contact_form'&gt;
      &lt;div id = 'result'&gt;&lt;/div&gt;
          &lt;form id="contactform" action="js/contact.php" method="POST"  enctype="multipart/form-data"&gt;
              &lt;div class="row"&gt;
                  &lt;input id="name" class="input" name="name" type="text" required = 'true' value="" size="30" placeholder='Nome'/&gt;
              &lt;/div&gt;
  
              &lt;div class="row"&gt;
                  &lt;input id="email" class="input" name="email" type="text" required = 'true' value="" size="30" placeholder = 'Email'/&gt;
              &lt;/div&gt;
  
              &lt;div class="row"&gt;
                  &lt;textarea id="message" class="input" name="message" rows="7" cols="50" required = 'true' placeholder = 'Messagio'&gt;&lt;/textarea&gt;
              &lt;/div&gt;
  
              &lt;input id="submit_button" class = 'myButton' type="submit" value="Manda messagio" /&gt;
          &lt;/form&gt;
      &lt;/div&gt;                      
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$('#submit_btn').click(function(){
      var user_name = $("input#name").val();
  
      if (user_name == "") {
          $("input#name").focus().addClass('active');
          return false;
       }
  
      var user_email = $("input#email").val();
  
      if (!$("input#email").val().match(/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/)) {
              $("input#email").focus().addClass('active');
              return false;
       }
  
       var msg = $("textarea#message").val();
  
      if (message == "") {
          $("textarea#message").focus().addClass('active');
          return false;
       }
  
       var dataString = 'name='+ user_name + '&amp;email=' + user_email +'message = ' + msg;
      //alert (dataString);return false;
  
  
      // Send the request
      $.ajax({
          type: "POST",
          url: "contact.php",
          data: dataString,
          success: function(d) {
              console.log(d);
          }
      });
  
      return false;
  });
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php
      $toEmail = "x@gmail.com";
      $subject = "dal tuo sito ";
      $mailHeaders = "From: " . $_POST["name"] . "&lt;". $_POST["email"] ."&gt;\r\n";
  
      if(mail($toEmail,$subject,$_POST["message"], $mailHeaders)) {
          echo "Mail Sent";
      } else {
          echo "Problem in Sending Mail";
      }
  ?&gt;
  </code></pre>