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

Word format stripping not working if viewing HTML tab on submit

3 Answers 69 Views
Editor
This is a migrated thread and some comments may be shown as answers.
HorseFly
Top achievements
Rank 1
HorseFly asked on 27 Nov 2013, 05:45 PM
If you are viewing the HTML tab in the Editor when submitting, it doesn't do the Word format strip.  It doesn't work in the demo:  http://demos.telerik.com/aspnet-ajax/editor/examples/cleaningwordformatting/defaultcs.aspx

I tried it in both IE and Chrome.  It does work if you are viewing the Design or Preview option.  I assume this has something to do with the HTML content being in an IFrame.

I had searched around on the forum but did not find anything about this being a known issue.  If there is a workaround, I would like the steps.  

Thanks!



3 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 28 Nov 2013, 06:30 AM
Hi Cindy,

The strip formatting options are triggered only when content is being pasted in the Design mode of the Editor. The HTML one is intended only for HTML code. If the case is that you are pasting MS Word content in the HTML tab, then the described behavior is expected.

If somehow I am mislead on the problem, please get back to me with detailed steps leading to the described issue.

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.
0
HorseFly
Top achievements
Rank 1
answered on 30 Nov 2013, 10:52 PM
I pasted into the Design mode (RadEditor1.png).  Then I switched over to the HTML view so I could see the tags that were created from the paste (RadEditor2.png).  Then I hit the Submit and Clean button while still viewing the HTML.  It doesn't strip the Word formatting (RadEditor3.png).  

The only way it works is if you switch back over to the Design tab or the Preview tab before hitting the Submit and Clean button.
0
Accepted
Ianko
Telerik team
answered on 02 Dec 2013, 07:28 AM
Hi Cindy,

The format stripping tool, which is triggered by the submit button is designed to work with the editor's content. When the RadEditor control is switched to HTML mode, the content appears as text in a textarea element, with which the formatting cannot be stripped correctly.

I can suggest setting the mode to Design before stripping the Word formatting. You could follow this example setup for your project:
<telerik:RadEditor runat="server" ID="RadEditor1"
    OnClientSubmit="OnClientSubmit">
</telerik:RadEditor>
 
<asp:Button ID="Button1" runat="server"
    Text="Submit and Clean"></asp:Button>
 
<script>
    function OnClientSubmit(editor, args) {
        editor.set_mode(Telerik.Web.UI.EditModes.Design);
        editor.fire("FormatStripper", { value: "WORD" });
    }
</script>


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
HorseFly
Top achievements
Rank 1
Answers by
Ianko
Telerik team
HorseFly
Top achievements
Rank 1
Share this question
or