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

How to restrict keys of Numpad in Rad Editor

2 Answers 85 Views
Editor
This is a migrated thread and some comments may be shown as answers.
UMA MAHESWARA RAO
Top achievements
Rank 1
UMA MAHESWARA RAO asked on 30 Jan 2012, 01:05 PM
Hello Everyone,
I need to restrict the Numpad keys to enter in the Rad Editor.

2 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 30 Jan 2012, 02:06 PM
Hi,

You can see how to attach to the onkeydown event and check the key number in this demo: attachEventHandler.
You can prevent the key execution with $telerik.cancelRawEvent(e);

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Shinu
Top achievements
Rank 2
answered on 30 Jan 2012, 02:51 PM
Hello Uma,

Try the following Javascript to restrict keys of Numpad
JS:
<script type="text/javascript">
function OnClientLoad(editor, args)
{
 editor.attachEventHandler("onkeydown", function (e)
  {
   if (e.keyCode > 95 && e.keyCode <= 105)
   {
      return false;
   }
   else
   {
     return true;
   }
  });
}
</script>

-Shinu.
Tags
Editor
Asked by
UMA MAHESWARA RAO
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Shinu
Top achievements
Rank 2
Share this question
or