title: Two Events Fired when I press enter key
body: <p>In my code, I have the following javascript code block in the header section</p>
  
  <pre><code>    function validateForm(bid) {
          switch (bid) {
          case "submitIDSearch":
              alert("submitIDSearch");
              return false;
          case "submitNameSearch":
              alert("submitNameSearch");
              return false;
          }
      }
      function fKeyDown(e) {
          var  kc = window.event ? window.event.keyCode : e.which;
          if (kc == 13) {
              document.getElementById('submitNameSearch').click();
          }
      }
  </code></pre>
  
  <p>Then I have the following HTML code block</p>
  
  <pre><code>    &lt;form name="checkAbsenceForm" method="post" action="absenceReport.htm" onsubmit="return validateForm(this.submited)"&gt;
          &lt;label class="q"&gt;ID * &lt;input id="searchRUID" name="searchID" maxlength="9" /&gt;&lt;/label&gt;
          &lt;input id="submitIDSearch" type="submit" value="Search ID" onclick="this.form.submited = this.id;" /&gt;
          &lt;hr /&gt;
          &lt;label class="q"&gt;First Name &lt;input id="searchFirstName" name="searchFirstName" maxlength="23" onKeyDown="javascript:fKeyDown(event);"/&gt;&lt;/label&gt;
          &lt;br /&gt;
          &lt;label class="q"&gt;Last Name * &lt;input id="searchLastName" name="searchLastName" maxlength="23" onKeyDown="javascript:fKeyDown(event);" /&gt;&lt;/label&gt;
          &lt;input id="submitNameSearch" type="submit" value="Search Name" onclick="this.form.submited = this.id;" /&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>What happened was that when I press <kbd>Enter</kbd> key in the <code>searchLastName</code> input text box, both alert message box pops up. One showing <code>submitNameSearch</code> and the other showing <code>submitIDSearch</code>. <code>submitNameSearch</code> is the desired event, but <code>submitIDSearch</code> is not, I think it is somehow triggered by default.</p>
  
  <p>May I ask if there's a way to get rid of the <code>submitIDSearch</code> event when I press <kbd>Enter</kbd> key in the searchLastName input text box?</p>
  
  <p>Thanks a lot!</p>