title: Simple HTML input onkeypress event not working
body: <p>I'm new here (and to web development in general), and I have been trying to understand why my function is not being executed on the specified event.</p>
  
  <p>I found this post, and it seems exactly like what I want, but even this did not work:</p>
  
  <p><a href="https://stackoverflow.com/questions/6290442/html-input-type-text-onchange-event-not-working">html &lt;input type=&quot;text&quot; /&gt; onchange event not working</a></p>
  
  <p>Any help would be appreciated. My exact code follows. I have some text input fields (actually search boxes), and ultimately I want to have it check a checkbox when the user enters data into the text fields, but it doesn't even seem to call the function.</p>
  
  <p>I have tried a few variants while reading the post mentioned above. Here are some input field attributes I have tried:</p>
  
  <pre><code>&lt;input type="date" name="dt" size="10" value="2012-07-21" onChange="SetCheckBox('d')" /&gt;
  &lt;input type="search" size="10" name="sl" value="" onChange="SetCheckBox('n')" /&gt;
  &lt;input type="search" size="10" name="sf" value="" onkeypress="SetCheckBox('n')" /&gt;
  &lt;input type="search" size="20" name="st" value="" onkeypress="SetCheckBox(this);" /&gt;
  </code></pre>
  
  <p>and here is my javascript:</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
      Function SetCheckBox(id) {
          alert (id.value);
          document.write('test');
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I have tried not passing any arguments and just doing a document.write, but it doesn't seem to be calling the function. And yes, javascript is enabled and working elsewhere on the page just fine!
  The script is in the body, just below the form.</p>
  
  <p>The (lack of) behavior is the same in multiple browsers.
  Thank you for any help you can provide.
  Ray</p>