R
Robert S
I am using the following to prevent the Enter key from submitting my
form (this would have undesirable results):
(index.html)
<body onkeydown="rejectEnter( event )">
(functions.js)
function rejectEnter( oEvent )
{
if ( 13 == oEvent.keyCode )
{
try
{
oEvent.preventDefault();
}
catch ( oError )
{
oEvent.returnValue = false;
}
}
}
This works fine in Firefox, IE6 and Konqueror, but it does not reject
the keypress in Opera (9.0). Is there an easy way of doing this in
Opera using code similar to the above?
It looks like it execultes the line "oEvent.preventDefault();", but it
does not have the desired effect.
form (this would have undesirable results):
(index.html)
<body onkeydown="rejectEnter( event )">
(functions.js)
function rejectEnter( oEvent )
{
if ( 13 == oEvent.keyCode )
{
try
{
oEvent.preventDefault();
}
catch ( oError )
{
oEvent.returnValue = false;
}
}
}
This works fine in Firefox, IE6 and Konqueror, but it does not reject
the keypress in Opera (9.0). Is there an easy way of doing this in
Opera using code similar to the above?
It looks like it execultes the line "oEvent.preventDefault();", but it
does not have the desired effect.