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

RadEditor and contenteditable

1 Answer 102 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Wilbert
Top achievements
Rank 1
Wilbert asked on 29 Jul 2011, 02:29 AM
Hello everyone!

I pasted in the Radeditor content a <span> that contains a table and script code, I need select the Table in the design mode and press key "supr" to delete this <span> and its content.

I tried with this code that I found in the forums of this page, but it has a different behaviors in all browsers. 

<span contenteditable="false" unselectable="on" style="-moz-user-select: none;-webkit-user-select: none;
;"
>
   <script type="text/javascript">
        function example(){
        }
    </script>
<table>
    <tbody>
        <tr>
            <td>test</td>
        </tr>
    </tbody>
</table>
</span>

  • Internet explorer: works very fine, the <span> with its content is deleted.
  • Chrome: with this code I can't do anymore in the content of the Radeditor.
  • Firefox: Only selects the table, but I can't delete the table with the key "supr".

I hope you can help me with this.

Best Regards!

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Aug 2011, 02:00 PM
Hello Wilbert,

The content area of RadEditor is a standard editable IFRAME element and the reported issues are browser behavior. You will experience the same behavior with a standard editable IFRAME or DIV element as well as in the different competitors' editors.

RadEditor does not also manipulate the Delete / BackSpace commands when deleting content.

Perhaps the best way is to implement this as a separate solution using an editable DIV element (<div contenteditable="true" style="width:300px;height:300px;border: 1px solid red;">sample content</div> as the editor. If you are able to implement a fully functional solution that works with a standard editable DIV, we will help you integrate the code into the editor.

Best regards,
Rumen
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.

Tags
Editor
Asked by
Wilbert
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or