Sun River
Topics about Java SE, Servlet/JSP, JDBC, MultiThread, UML, Design Pattern, CSS, JavaScript, Maven, JBoss, Tomcat, ...
posts - 78,comments - 0,trackbacks - 0
<SCRIPT LANGUAGE="JavaScript1.3">
//Enter-listener
if (document.layers)
  document.captureEvents(Event.KEYDOWN);
  document.onkeydown =
    function (evt) {
      var keyCode = evt ? (evt.which ? evt.which : evt.keyCode) : event.keyCode;
      if (keyCode == 13)   //13 = the code for pressing ENTER

      {
         document.form.submit();
      }
    }
</SCRIPT>
posted on 2008-04-23 12:11 Sun River 阅读(320) 评论(0)  编辑  收藏