title: How to submit form on keypress?
body: <p>I use this <a href="http://www.javascripter.net/faq/searchin.htm" rel="nofollow">script</a> to search in a static page</p>
  
  <p>But i want this to search when i type in the text input and not when i click the button, i searchd and i found that any of this would work:</p>
  
  <pre><code>onkeypress="this.submit();"
  onkeyup="this.submit();"
  onkeypress="document.forms["f1"].submit();"
  onkeyup="document.forms["f1"].submit();"
  </code></pre>
  
  <p>but none of them works</p>
  
  <p>i used the same html with the script's</p>
  
  <pre><code>&lt;form id="f1" name="f1" action="javascript:void()" onsubmit="if(this.t1.value!=null &amp;amp;&amp;amp; this.t1.value!='')parent.findString(this.t1.value);return false;"&gt;
  &lt;input type="text" id="t1" name="t1" value="Search" onfocus="if(this.value=='Search')this.value='';" size="20" onkeypress="this.submit();" /&gt;
  &lt;input type="submit" name="b1" value="Find" /&gt;
  &lt;/form&gt;
  </code></pre>