This is a migrated thread and some comments may be shown as answers.

[Solved] Cancelling the Enter Key event

1 Answer 131 Views
Editor
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 08 Apr 2008, 12:14 PM
Hi

I'm using the following code to cancel key strokes, which is working fine for most keys. However it does not cancel the Enter key? Can anybody help me cancel this?

function TP_cancelEvent(e)

{

if(!e) { e = window.event; }

if(e.stopPropagation) { e.stopPropagation(); }

if(e.preventDefault) { e.preventDefault(); }

var editor = $find("<%=RadEditor1.ClientID%>"); //get a reference to RadEditor client object

var theSelectionObject = editor.getSelection();

var theSelectedElement = theSelectionObject.getParentElement();

alert(

'Event Cancelled.\n\ntheSelectionObject.getHtml()\n\n' + theSelectionObject.getHtml());

e.cancelBubble =

true;

e.cancel =

true;

e.returnValue =

false;

return false;

}

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 08 Apr 2008, 04:50 PM
Hi David,

Please, review the following forum thread which provides useful information about your scenario:
Readonly with onkeydown.

If you are not able to achieve your scenario, please open a support ticket and send a sample running project that demonstrates the problem. I will examine it and try to provide a solution.

Greetings,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
David
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or