title: Try to combine javascript confirm box with php post method?
body: <p>Here is the Javascript code, just for test:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function show_confirm()
          {
              var r=confirm("Are you sure?");
              if (r==true)
              {                   
              }
              else
              {                    
              }
          } 
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is the php code:</p>
  
  <pre><code>&lt;form action="Test.php" method="post"&gt;
      &lt;input type="text" name="test"/&gt;
      &lt;input type="submit" value="submit" onclick="show_confirm()"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>So if the submit button is clicked, a confirm box will pop out. And if "OK" button is clicked, the page will be redirected to Test.php and post method will be executed, like a normal php page submit operation. Or else, if the "cancel" button is clicked, i want it stay the same page and post method won't be executed. Is this function can be implemented and how to modify the code? I know PHP is for server and JS is for client. I'm not sure if I can mix them like this. Or I should use Ajax? Thanks for help!</p>