)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to make certain section of the text area in the RTE as editable and remaining as non-editable

Platform: ASP.NET Web Forms |
Control: RichTextEditor |
Published Date: September 6, 2016 |
Last Revised Date: May 8, 2019

Solution

Render the RTE control, and its content has two div sections. Consider that, the first ‘div’ is editable and second ‘div’ non editable.

Set the ID for the first “div” element as “editable” and the second “div” element as “non-editable”. Refer the following code

 

C#

<ej:RTE ID="ToolsSample" Width="850" ClientSideOnCreate="onCreate" Height="440" ShowFooter="true" runat="server" EnableRTL="false" Locale="en-US">
    <RTEContent>
        <div id="editable">
            Description:
            The Rich Text Editor (RTE) control is an easy to render in
            client side. Customer easy to edit the contents and get the HTML content for
            the displayed content. A rich text editor control provides users with a toolbar
            that helps them to apply rich text formats to the text entered in the text
            area.
        </div>
        <div id="noneditable">
        Functional Specifications/Requirements:
        Provide the tool bar support, it’s also customizable.
        Options to get the HTML elements with styles.
        Support to insert image from a defined path.
        Footer elements and styles(tag / Element information , Action button (Upload, Cancel))
    </div>
    </RTEContent>  
</ej:RTE>

 

In the client side event name called “create”, set the attribute of “contenteditable” as false to the “noneditable” div element.

 

Javascript

<script>

    function onCreate(args) {

        $(this._getDocument().body).find("#noneditable").attr("contenteditable", false);

    }

</script>

 

 

2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon