title: Check to see if a button is clicked on... not working
body: <p>Just a very brief explanation of what a part of my code does:</p>
  
  <ul>
  <li>I have two buttons that do different things. </li>
  <li>One of them lets the user search through the table/database for whatever he/she wants to search for</li>
  <li>The other lets the user insert things into the database</li>
  </ul>
  
  <p><strong>WHAT I'M TRYING TO DO:</strong>
  I'm trying to check to see which button the user clicked on so that the appropriate code will be executed. </p>
  
  <p>I've been looking around and pretty much everywhere I go, people are suggesting to use isset(), but it's not working for me. Perhaps I don't fully understand what isset() does, but doesn't it basically check to see whether a variable is set? </p>
  
  <p>Here's my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script&gt;
      function show(x, y){
        
          &lt;!-- Do something --&gt;
        
      }
  &lt;/script&gt;
  
  
  &lt;form&gt;
      &lt;button name = "sButton" type = "button" onclick = 'show("searchForm", "insertForm");'&gt;Perform Search&lt;/button&gt;
      &lt;button name = "iButton" type = "button" onclick = 'show("insertForm", "searchForm");'&gt;Insert Data&lt;/button&gt;
  &lt;/form&gt;
  
  
  &lt;form id = "searchForm" value "search" style = "display: none;" action = "test2.php" method = "post"&gt;
  
      &lt;!-- Do something --&gt;
    
  &lt;/form&gt;
  
  &lt;form id = "insertForm" style = "display: none;" action = "test2.php" method = "post"&gt;
  
      &lt;!-- Do something --&gt;
    
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- This is the test2.php page --&gt;
  
  if(isset($_POST['sButton'])){
     
      &lt;!-- Do something --&gt;
  
  }
  else{
     
      &lt;!-- Do something --&gt;
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>To test it, I had the if statement print "Checked" and the else print "Not checked". When I run my code, it prints "Not checked". What am I doing wrong and what should I be doing? </p>
  
  <p>Thanks in advance!</p>