title: Scope issue with JQuery call in external Javascript?
body: <p>I'm very new to Javascript and JQuery.</p>
  
  <p>MacOSX 10.8, Safari Version 6.0.3 (8536.28.10)</p>
  
  <p>I have a very simple HTML page with a form:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
      &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;link rel="stylesheet" href="wufooTheme8/css/theme.css" type="text/css" /&gt;
      &lt;title&gt;
          Course Search
      &lt;/title&gt;
      &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="http://yandex.st/json2/2011-10-19/json2.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="application2.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form method="post" id="class-find"&gt;
          &lt;label&gt;Class Name&lt;/label&gt; &lt;input type="text" name="classname" value=""/&gt; 
          &lt;input type="button" value="Go" onclick="classFind(this.form)" /&gt;
      &lt;/form&gt;     
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>In my application2.js file I have 2 calls/functions:</p>
  
  <pre><code>$('form').bind("keydown", function(e) {
    var code = e.keyCode || e.which;
    if (code  == 13) {
      e.preventDefault();
      return false;
    }
  });
  
  function classFind(frm) {
    alert('submitted!');
  }
  </code></pre>
  
  <p>The first is supposed to stop the enter key from submitting the form to the default action, which I took from another answer on SO but it is not working. The second function just shows an alert when the submit button is pressed, and it is working. I'm sure there's some javascript scope issue or something that I'm not familiar with, but I'm such a noob that I can't figure it out. </p>