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

Rad Editor Inserting nonbreaking space

2 Answers 62 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Rajasekhar
Top achievements
Rank 1
Rajasekhar asked on 09 Jan 2014, 03:42 PM
Hi 

We are using Telerik control Telerik.Web.UI.dll version "2013.2.717.40" . When we have some existing value on editor and then if we remove the value completely and we do not enter any new value in the rad editor, still editor returns "<P>&nsbp</P>" as value . We are expecting value as empty if nothing is entered in RadEditor

Please suggest

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Jan 2014, 06:23 AM
Hi Rajasekhar,

Please have a look into the following sample code snippet to achieve your scenario.

ASPX:
<telerik:RadEditor ID="RadEditor1" runat='server'>
</telerik:RadEditor>
<telerik:RadButton ID="RadButton1" runat="server" Text="Get Data" AutoPostBack="false"
    OnClientClicked="Click">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function Click(sender, args) {
        var editor = $find("<%=RadEditor1.ClientID %>");
        if (editor.get_text() == "") {
            editor.set_html("");
            alert(editor.get_html());
        }
    }
</script>

Thanks,
Shinu.
0
Ianko
Telerik team
answered on 13 Jan 2014, 06:54 AM
Hi Rajasekhar,

Note that if the editor is set with the NewLineMode="P" property it is expected such element to be left in the content if it is not deleted. Please review this screencast, in which is shown this behavior.

Regards,
Ianko
Telerik
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 the blog feed now.
Tags
Editor
Asked by
Rajasekhar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ianko
Telerik team
Share this question
or