Word format stripping not working if viewing HTML tab on submit

4 posts, 1 answers
  1. HorseFly
    HorseFly avatar
    35 posts
    Member since:
    Aug 2006

    Posted 27 Nov 2013 Link to this post

    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!



  2. Ianko
    Admin
    Ianko avatar
    1934 posts

    Posted 28 Nov 2013 Link to this post

    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.
  3. HorseFly
    HorseFly avatar
    35 posts
    Member since:
    Aug 2006

    Posted 30 Nov 2013 Link to this post

    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.
  4. Answer
    Ianko
    Admin
    Ianko avatar
    1934 posts

    Posted 02 Dec 2013 Link to this post

    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.
Back to Top