title: How to have two buttons in a same form to do different actions in ajax?
body: <p>I have a form, which take name from form and it sends to javascript codes and show in php by Ajax. these actions are done with clicking by submit button, I need to have another button, as review in my main page. how can I address to ajax that in process.php page have "if isset(submit)" or "if isset(review)"? 
  I need to do different sql action when each of buttons are clicked. 
  how can I add another button and be able to do different action on php part in process.php page? </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          $("#myform").validate({
              debug: false,
  
              submitHandler: function(form) {
              $.post('process.php', $("#myform").serialize(), function(data) {
                      $('#results').html(data);
                  });
              }
          });
      });
      &lt;/script&gt;
  &lt;body&gt;
  &lt;form name="myform" id="myform" action="" method="POST"&gt;  
        &lt;label for="name" id="name_label"&gt;Name&lt;/label&gt;  
      &lt;input type="text" name="name" id="name" size="30" value=""/&gt;  
      &lt;br&gt;
      &lt;input type="submit" name="submit" value="Submit"&gt; 
  &lt;/form&gt;
      &lt;div id="results"&gt;&lt;div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>process.php:</strong></p>
  
  <pre><code>&lt;?php
  
      print "&lt;br&gt;Your name is &lt;b&gt;".$_POST['name']."&lt;/b&gt; ";
  ?&gt;
  </code></pre>