radEditor keeps inserting a newline on ie6

3 posts, 0 answers
  1. Filipe Peixinho
    Filipe Peixinho avatar
    41 posts
    Member since:
    May 2006

    Posted 27 Jul 2011 Link to this post

    Greetings,

     

    I'm currently using radEditor (Version 2011.1.519.3) to build a chat application. To obtain the desired user experience, i have been able to reproduced the two suggested approaches on this link: http://www.telerik.com/community/forums/aspnet/editor/can-you-disable-multiline-on-telerik-radeditor.aspx

     

    It's everything working well, the problem is in ie6. I'm not able to make it work in ie6 because it keeps inserting a newline everytime i press the enter key.

     

    Can you provide some help?

  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 28 Jul 2011 Link to this post

    Hi Filipe,

    The problem is not directly related to RadEditor but it seems that standard keydown event is not fired for enter and escape keys. To handle this scenario you can attach additional handler for IE6 to the keypress event, e.g.:
    <script type="text/javascript">
        function OnClientLoad(editor)
        {
            editor.attachEventHandler("onkeydown", function (eventArgs)
            {
                var key = eventArgs.keyCode;
                if (key == "13")
                {
                    $telerik.cancelRawEvent(eventArgs);
                }
            });
     
            if ($telerik.isIE6)
            {
                editor.attachEventHandler("onkeypress", function (eventArgs)
                {
                    var key = eventArgs.keyCode;
                    if (key == "13")
                    {
                        $telerik.cancelRawEvent(eventArgs);
                    }
                });
            }
        }
    </script>
    <telerik:RadEditor ID="RadEditor1" NewLineBr="false" OnClientLoad="OnClientLoad"
        runat="server">
    </telerik:RadEditor>



    Best wishes,
    Dobromir
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Filipe Peixinho
    Filipe Peixinho avatar
    41 posts
    Member since:
    May 2006

    Posted 29 Jul 2011 Link to this post

    Hi Dobromir,

    It worked. Thank you very much.
Back to Top