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

[Solved] Editor Adds rogue "<p> </p>"

1 Answer 86 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Richard Buff
Top achievements
Rank 1
Richard Buff asked on 24 Aug 2009, 07:50 PM
Hi,

For some reason, when a user clears text from a radeditor, the editor actually contains a "<p>&nbsp;</p>" when the form is posted. 

To be clear: a user opens a web page with a radeditor and there is "Some text" in the control.  The user clicks in the control and clears out all the text.  To the user, the box looks clear.  When the form is posted, we have some javascript that checks the control to validate the text.  What it is finding is "<p>&nbsp;</p>" while I would expect to find "".

How can we correct this behavior?

Here is the text of my control:

 

<telerik:RadEditor ID="txtBookmark" runat="server" Height="70px"

 

 

Width="415px" OnClientLoad="SetCorrectSize" EditModes="Design" EnableResize="False" Skin="Office2007"> <Tools>

 

 

<telerik:EditorToolGroup>

 

 

<telerik:EditorTool Name="AjaxSpellCheck" />

 

 

</telerik:EditorToolGroup>

 

 

</Tools>

 

 

</telerik:RadEditor>

Thanks!
Rich

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 27 Aug 2009, 01:37 PM
Hi Richard,

The empty paragraph is added by Internet Explorer and this is a default browser behavior. However when the FixEnclosingP content filter of RadEditor is enabled (it is enabled by default) then this tag will be stripped by RadEditor.

Please see the attached video for more information. You will see that the FixEnclosingP filter will strip the paragraph tag added by the browser when submitting the content or switching to another View mode of the control.

The video has RAR compression and can be extracted with WinRar or 7-Zip.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Richard Buff
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or