Check to see if the ENTER key was pressed.

This code will trap if the ENTER key was pressed in both Internet Explorer and Netscape browsers
HTML


<script language="JavaScript1.2">
//CHECKS IF THE ENTER WAS PRESSED	
			function netscapeKeyPress(e) {
   			 if (e.which == 13)
        			       alert('Enter pressed');
			}
			function microsoftKeyPress() {
  			  if (window.event.keyCode == 13)
 			       alert('Enter pressed');
 			}
			if (navigator.appName == 'Netscape') {
    			window.captureEvents(Event.KEYPRESS);
  				window.onKeyPress = netscapeKeyPress;
			}		
</script>
<body  onKeyPress="microsoftKeyPress()" >

Posted by fbrefere001 on Saturday January 29, 2005