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

radEditor keeps inserting a newline on ie6

2 Answers 53 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Filipe Peixinho
Top achievements
Rank 1
Filipe Peixinho asked on 27 Jul 2011, 11:29 AM

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 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 28 Jul 2011, 04:47 PM
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.

0
Filipe Peixinho
Top achievements
Rank 1
answered on 29 Jul 2011, 11:00 AM
Hi Dobromir,

It worked. Thank you very much.
Tags
Editor
Asked by
Filipe Peixinho
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Filipe Peixinho
Top achievements
Rank 1
Share this question
or