Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: how to disable 'Enter' key


Message #1 by Christine_Sun@c... on Tue, 17 Dec 2002 11:27:21 -0800
Thanks very much!  It works!

-----Original Message-----
From: Earl Robb [mailto:erobb@b...] 
Sent: Tuesday, December 17, 2002 11:34 AM
To: javascript
Subject: [javascript] RE: how to disable 'Enter' key

function keyProcess()
{
	if(event.keyCode==13)
	{
		return false;
	}
}

</script>

<body onkeydown="return keyProcess()" >
<form action="http://www.yahoo.com" method="post">
<input name="test" type="text">
</form>

Earl Robb


-----Original Message-----
From: Christine_Sun@c...
[mailto:Christine_Sun@c...] 
Sent: Tuesday, December 17, 2002 2:27 PM
To: javascript
Subject: [javascript] how to disable 'Enter' key


Hi, guys,

I need to disable 'Enter' key in one of my pages.
What I have is the following.  What do I have to
Replace the alert line in order to diable 'Enter' key?


function keyProcess()
{
	if(event.keyCode==13)
	{
		alert("Key is 13");
	}
}
<body ... onkeydown=keyProcess()>



Thanks in Advance.

Christine




  Return to Index