title: jquery form submit and display results in div witout reload
body: <p>Good day,</p>
  
  <p>I found some of the code below on stackoverflow, but for the life of me I can't get this to work.  I've played with the code a little bit, but I'm still learning javascript (slowly) and jquery.</p>
  
  <p>What I'd like to do, is to have a search div with a search input, but instead of reloading the page, I'd like a div below the search to display the results, without a reload.  Type in a search and click 'Search'.  Here is my code, which does nothing, I might add:</p>
  
  <p>My jquery version is 1.5.2 and is loaded with the <code>include("javascript.php");</code></p>
  
  <pre><code>&lt;?php
  include("search_div.php");
  include("javascript.php");
  ?&gt;
  
  &lt;script type="text/javascript"&gt;
  
  $("search").submit(function() {
      $.post($(this).attr("action"), $(this).serialize(), function(html) {
          $("#results").html(html);
      });
      return false; // prevent normal submit
  });
  
  &lt;/script&gt;
  
  &lt;div id="content"&gt;
  
      &lt;div id="searchdiv"&gt;
          &lt;form type="submit" onsubmit="return false;" name="search" id="search" method="post"&gt;
          &lt;table border="0" width="850" id="searchquery" cellpadding="0" cellspacing="0"&gt;
              &lt;tr&gt;&lt;td align="center"&gt;Search Query: &lt;input type="text" size="50" id="q" name="q"&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;/table&gt;
          &lt;table border="0" width="850" id="searchquerybuttons" cellpadding="0" cellspacing="0"&gt;
          &lt;td align="right" width=840&gt;&lt;input type="Submit" value="Search"&gt;
          &lt;/table&gt;
  
          &lt;/form&gt;
      &lt;/div&gt; &lt;!-- end search div --&gt;
  
      &lt;div id="results"&gt;
          &lt;?php
          if (isset($_POST['q'])) {
              echo "&lt;br&gt;&lt;br&gt;Query is: ".$_POST['q'];
              }
          ?&gt;
      &lt;/div&gt;  &lt;!-- End results div --&gt;
  
  &lt;/div&gt; &lt;!-- End content div --&gt;
  
  &lt;?php
  include ("footer.php");
  ?&gt;
  
  &lt;/div&gt; &lt;!-- End of container div --&gt;
  </code></pre>