Checking two events in one html tag
<p>I want to check two things in the form, one is onclick and the other "enter" function. So that, alert will be used by clicking the button or pressing "enter". But, "enter" function is not working(There is no problem with "onclick"). Where is the problem? Codes;</p>

<pre><code>&lt;FORM NAME="myform" ACTION="" METHOD="GET"&gt;Enter something in the box: &lt;BR&gt;
&lt;INPUT TYPE="text" NAME="inputbox" VALUE=""&gt;&lt;P&gt;
&lt;INPUT TYPE="button" NAME="button" Value="Click" onClick="testResults(this.form)" onKeyDown="keyevent(event)"&gt;
&lt;/FORM&gt;


Javascript    

&lt;SCRIPT LANGUAGE="JavaScript"&gt;
function testResults (form) {
    var TestVar = form.inputbox.value;
    alert ("You typed: " + TestVar);
}
function keyevent(e)
        {
          if (e.keyCode == 13) 
          var TestVar2 = form.inputbox.value;
    alert ("You typed: " + TestVar2);
}
&lt;/SCRIPT&gt;
</code></pre>

<p>Thanks</p>
