Hello!
When user presses the return key, the focus should be set to the next control (as tab key does) instead of adding a new line. To enter a new line the user should press Shift+Return. How is this possible?
Thanks in advance and regards
Markus Weber
When user presses the return key, the focus should be set to the next control (as tab key does) instead of adding a new line. To enter a new line the user should press Shift+Return. How is this possible?
Thanks in advance and regards
Markus Weber
4 Answers, 1 is accepted
0
Hi Markus,
I prepared for you and attached a sample example based on the RadEditor's Client Side API.
When pressing the TAB or Enter key you will set the focus on the next control. When pressing Shift+Enter you will insert a new line (a paragraph tag) in the editor.
Feel free to optimize the solution to fit your scenario and requirements.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I prepared for you and attached a sample example based on the RadEditor's Client Side API.
When pressing the TAB or Enter key you will set the focus on the next control. When pressing Shift+Enter you will insert a new line (a paragraph tag) in the editor.
Feel free to optimize the solution to fit your scenario and requirements.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Markus
Top achievements
Rank 1
answered on 11 Feb 2009, 09:59 AM
Hello Rumen,
thanks for the sample, but on Shift+Return nothing happens. The code will be executed, but this doesn't reault ni a new line. Any ideas?
Regards Markus
thanks for the sample, but on Shift+Return nothing happens. The code will be executed, but this doesn't reault ni a new line. Any ideas?
Regards Markus
0
Hi Markus,
I examined the code and found that the reason for the problem is the following check:
if (range.pasteHTML).
To fix it delete the pasteHTML property and keep only the range object, e.g.
if (range)
For your convenience I have attached a video demonstrating my test.
Sincerely,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I examined the code and found that the reason for the problem is the following check:
if (range.pasteHTML).
To fix it delete the pasteHTML property and keep only the range object, e.g.
if (range)
For your convenience I have attached a video demonstrating my test.
Sincerely,
Rumen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Markus
Top achievements
Rank 1
answered on 16 Feb 2009, 09:44 AM
Hello Rumen,
now I found the reasion why you can't redo the problem. It happens only if there is no text entered or if the cursor is at the beginning or at the end of a line. I those case no "<P>" will be added.
Regards Markus
now I found the reasion why you can't redo the problem. It happens only if there is no text entered or if the cursor is at the beginning or at the end of a line. I those case no "<P>" will be added.
Regards Markus