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

[Solved] editor.fire("StripWord"); returns args not defined error

3 Answers 119 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Naz Junaid
Top achievements
Rank 1
Naz Junaid asked on 30 May 2008, 09:16 AM
Hi
I'm trying to follow this documentation to strip formatting on page load

http://www.telerik.com/help/aspnet-ajax/cleaningwordformattingonpageloadandonsubmit.html

However the editor.fire("StripWord"); throws me a javascript error args not defined.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Jun 2008, 08:29 AM
Hello Naz Junaid,

Please, replace the editor.fire("StripWord"); with editor.fire("FormatStripper", {value : "WORD"});
,e.g.

<script type="text/javascript">
function OnClientLoad(editor, args)
{
   editor.add_submit(function ()
   {
      editor.fire("SelectAll");
      editor.fire("FormatStripper", {value : "WORD"});
      alert(editor.get_html(true));
});
}
</script>
<telerik:radeditor runat="server" OnClientLoad="OnClientLoad" ID="RadEditor1">
   <Content>
      
       <p><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">  </p>
       <p class=MsoNormal><b style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 10pt; BACKGROUND: red; COLOR: #ff9900; mso-bidi-font-family: Arial; mso-highlight: red">Sampe MS Word content</span></b><b style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 10pt; COLOR: #ff9900; mso-bidi-font-family: Arial"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></span></b></p></span></span>
      
   </Content>
</telerik:radeditor>
<asp:Button ID="Button1" runat="server" Text="Submit" />

This should fix the problem. I will update the documentation.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Naz Junaid
Top achievements
Rank 1
answered on 02 Jun 2008, 01:57 PM
editor.fire("FormatStripper", {value : "WORD"});

doesn't do anything

however i tried

editor.fire("FormatStripper", {value : "ALL"});

and this works but now quite what i wanted. Is it possible to get a list of all the options we can pass in?
0
Rumen
Telerik team
answered on 02 Jun 2008, 04:00 PM
Hi Naz,

The provided code should work properly. If needed, I can attach a sample running project that you can test - just let me know.

The other possible options are All, CSS, WORD_ALL.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Naz Junaid
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Naz Junaid
Top achievements
Rank 1
Share this question
or