1. Regula
    Regula avatar
    47 posts
    Member since:
    Sep 2005

    Posted 05 Apr 2012 Link to this post

    Hi,

    I'm using the javascript to overide the displayMaxHTMLLengthErrorMessage

    <script type="text/javascript">
     
        Telerik.Web.UI.RadEditor.prototype.displayMaxHTMLLengthErrorMessage = function () {
            alert("Hello!");
        }
    </script>

    Here is my Radeditor definition:

    <telerik:RadEditor ID="myEditor" runat="server" StripFormattingOnPaste="AllExceptNewLines" Width="100%" MaxHtmlLength="2000" >  </telerik:RadEditor>



    My problem is that I can't get the function to be override, I'm sttil getting the default telerik message: "The added HTML code exceeded the caracter.... ".  I don't get any error javascript message. Its just like I didn't declared nothing.


    Why my javascript code is not overriding the default message?

  2. Answer
    Rumen
    Admin
    Rumen avatar
    14390 posts

    Posted 05 Apr 2012 Link to this post

    Hi,

    You have a typo in the displayMaxHtmlLengthErrorMessage method name. The code should be:
    <telerik:RadEditor MaxHtmlLength="10" runat="server" ID="RadEditor1"></telerik:RadEditor>
    <script type="text/javascript">
        Telerik.Web.UI.RadEditor.prototype.displayMaxHtmlLengthErrorMessage = function () {
            alert("test");
        }
    </script>



    All the best,
    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.
Back to Top