title: jQuery form submit event not working at all
body: <p>The following is my code. What I want is for the whenever the form is submitted to run the 3 jQuery lines that move around some positioning and visibility. Right now, whenever I submit the form, nothing happens. Where am I going wrong at?</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
     &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Webther - What's it like out?&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="css/desktop.css" /&gt;
      &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
      function showResult(str)
      {
      if (str.length==0)
        { 
        document.getElementById("livesearch").innerHTML="";
        document.getElementById("livesearch").style.border="0px";
        return;
        }
      if (window.XMLHttpRequest)
        {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
        }
      else
        {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
      xmlhttp.onreadystatechange=function()
        {
        if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
          {
          var response=xmlhttp.responseText;
      if (response.length!=0)
        { 
          document.getElementById("livesearch").innerHTML=xmlhttp.responseText;
          document.getElementById("livesearch").style.border="1px solid #A5ACB2";
        }
          }
        }
      xmlhttp.open("GET","livesearch.php?q="+str,true);
      xmlhttp.send();
      }
  
      function ChangeVal()
      {
      document.getElementById("searchbox").value="";
      }
      &lt;/script&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;div id="pagecontainer"&gt;
          &lt;div id="indexlogocontainer"&gt;
              &lt;img id="indexlogo" src="images/fulllogo.png" /&gt;
          &lt;/div&gt;
          &lt;div id="indexsearchcontainer"&gt;
  
                  &lt;div id="searchsurround"&gt;&lt;form id="searchform"&gt;&lt;input type="text" autocomplete="off" id="searchbox" name="q" size="50" value="Enter a city or zipcode here!" onkeyup="showResult(this.value)" onclick="ChangeVal()"/&gt;
                  &amp;nbsp;&amp;nbsp;&lt;input type="image"  alt="Go!"   src="images/goicon.jpg" id="searchsubmit" /&gt;&lt;/form&gt;&lt;/div&gt;
      &lt;script type="text/javascript"&gt;
  $("form").submit(function() {
      $("#indexlogocontainer").animate({ marginTop: '-40px' }, 1000);
      $("#mylocations").fadeOut("slow");
      $("#forecast").fadeIn("slow");
      return false;
    });​
      &lt;/script&gt;
                  &lt;div id="livesearch"&gt;&lt;/div&gt;
  
          &lt;/div&gt;
          &lt;div id="mylocations"&gt;
              &lt;h1&gt;My Locations&lt;/h1&gt;
              &lt;ul&gt;
                  &lt;li&gt;BLAH&lt;/li&gt;
                  &lt;li&gt;Blah!&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
          &lt;div id="forecast" style="display: none;"&gt;
              PAGE INFO
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>