Click to See Complete Forum and Search --> : disable the enter key?


rjusa
11-06-2003, 10:32 AM
I'm using the following code:

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

<body onkeydown="return keyProcess()">

Well, this works fine if you're not in a text entry field...if you are and hit enter, the form goes to submit. Any thoughts?

Thanks,
Ron

Khalid Ali
11-06-2003, 10:50 AM
use some other events as well such as

onkeyup

and then you cna put extra conditions as well to make sure it returns false when there are text fields in focus

rjusa
11-06-2003, 10:53 AM
the code I supplied at the beginning of this thread works in IE but not in Netscape...thought I should clarify...