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

RadEditor Character Limit

5 Answers 123 Views
Editor
This is a migrated thread and some comments may be shown as answers.
rck
Top achievements
Rank 1
rck asked on 29 Sep 2009, 09:07 AM
Hello,

With radeditor, is there any option like "accept 21 characters in a line. if character length > 21 go to a new line automatically". İ searched the forum but couldnt find an example about it. My scenario is like that :

With radeditor, is<br/>
there any option like<br/>
"accept 21 characters<br/>
in a line. <br/>
if character length...
 
If there is any example or suggestion, i am waiting for them (if there is any possibility of achieving this scenario) .   (:

i use these in development environment

RadControls version

RadControls for ASP.Net Ajax

.NET version

3,5

Visual Studio version

2008

programming language

C#

CSS                    

Validation 2.1

Browser
Version                   

Changes To Client



Thanks in advance

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Sep 2009, 10:22 AM
Hello,

I guess the following links would be of help in getting started in limiting the characters typed in RadEditor.
Charector limit in RadEditor
Including a Symbol Counter and Limit the Text Length

-Shinu.
0
rck
Top achievements
Rank 1
answered on 29 Sep 2009, 10:34 AM
Hello,

Thanks for the reply. These examples are  a bit different from my screnario. I was wondering about whether there is a built in function like these scenarios in radeditor or not. I will try to make a manual solution for this.
Thanks for the interest.
Best wishes
0
rck
Top achievements
Rank 1
answered on 30 Sep 2009, 08:56 AM

Hello,

i am trying to use
OnClientPasteHtml="OnClientPasteHtml"
option in radeditor like in examples that are given in the forum posts. But i think there is a problem with my side because command name is always undefined in OnClientPasteHtml js function. my code is


<telerik:RadEditor ContentAreaCssFile="~/App_Themes/voucherEditor.css" ID="voucher" Width="800" runat="server" Skin="Web20" ToolbarMode="Default" ToolsFile="~/App_Data/BasicEditor.xml" OnClientLoad="LimitCharacters" OnClientPasteHtml="OnClientPasteHtml" >
            </telerik:RadEditor>  

function OnClientPasteHtml(editor, args) {
            var commandName = args.get_commandName(); //here is always undefined 
            var value = args.get_value();

            if (commandName == "PasteFromWord"
                || commandName == "PasteFromWordNoFontsNoSizes"
                || commandName == "PastePlainText"
                || commandName == "PasteAsHtml"
                || commandName == "Paste") {
                var textLength = CalculateLength(editor, value);
                if (textLength >= maxLimit) {
                    editor.set_html(WrapText(value));

                }
            }
        }

is there something wrong with my code?

Thanks in advance.

0
Rumen
Telerik team
answered on 01 Oct 2009, 12:48 PM
Hi rck,

It seems that you are using an older version of RadEditor the OnClientPasteHtml event of which is not fired when the onpaste browser event is executed. This feature was introduced in the latest versions of the control. To solve the problem you should upgrade to the latest Q2 2009 SP1 version 2009.2.826 of Telerik.Web.UI.dll.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
rck
Top achievements
Rank 1
answered on 01 Oct 2009, 12:51 PM
ok, thanks for the interest
Tags
Editor
Asked by
rck
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
rck
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or