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

I need to supress few charecters while copying text from MS Word to RadEditor control

1 Answer 15 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Atluri
Top achievements
Rank 1
Atluri asked on 17 Aug 2012, 10:09 AM
I need to supress few charecters while copying text from MS Word to RadEditor control such as ' (single quote)  and " (Double quotes). Below is the example.
 

Below employees are requested me at HR’s desk in

“Chris”

“Jhon”


This is different from the radEditior text

Below employees are requested me at HR's desk in

"Chris"

"Jhon"


is there any way to replace\supress this type of data as well ?
I have used reEditor.StripFormattingOptions = Telerik.Web.UI.EditorStripFormattingOptions.MSWordRemoveAll;
but not helped.

1 Answer, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 17 Aug 2012, 12:12 PM
Hi,

You can attach to the OnClientPasteHtml property of RadEditor and modify the pasted content when the Paste command is executed, e.g.

<script type="text/javascript">
function OnClientPasteHtml(sender, args)
{
    var commandName = args.get_commandName();
    var value = args.get_value();
    
    if (commandName == "Paste")
    {
        re = /“/gi;
        re1 = /”/gi;
        value= valuereplace(re, "\"").replace(re1, "\"");


        args.set_value(value);  //set the modified content in the editor
    }
}
</script>

Greetings,
Rumen
the Telerik team
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 their blog feed now.
Tags
Editor
Asked by
Atluri
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or