title: JQuery - Click Submit Button Get Form Value
body: <p>I have the following function and all i am trying to do is get the value out of the form field.  </p>
  
  <pre><code>$( ".searchbutton" ).click(function() {
      var tc = $(this).closest("form input[name='searchbox']").val();
      alert(tc);      
      return false;
  }); 
  </code></pre>
  
  <p>The alert keeps telling me "Undefined".  I have treid closest, parent, parents, find, etc.  I don't know what im doing wrong.  Im clicking the submit button and all i want in return is the value in the search box.  Please help.</p>
  
  <p>html</p>
  
  <pre><code>&lt;form action="/index.php" method="get" class="qsearch" &gt;
  &lt;input type="text" id="fsearch" name="searchbox" &gt;
  &lt;input class="searchbutton" type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>