title: How to submit and validate a form via ajax
body: <p>Please I am trying to simultaneously submit and validate my form to my database through the use of Ajax, but it is not working for me.
  Here is my jquery </p>
  
  <pre><code>$(document).ready(function(){
         $(".button").click(function(){
               $("#myform").validate();
  
              //Ajax to process the form
         $.ajax({
             type: "POST",
             url: "process.php",
             data: { firstname: $("#firstname").val()},
             success: function(){
                                 $('#message').html(data);
                                 }
                 });
            return false;
         });
        });
  </code></pre>
  
  <p>The problem is when I submit the form,the Ajax form submit to itself.
  Please  What is the right way to use the jquery validate and $.ajax together?</p>