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

Copy And Paste Issue in FireFox on MAC

1 Answer 13 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Abhinandan Bansal
Top achievements
Rank 1
Abhinandan Bansal asked on 20 Mar 2012, 02:28 PM
Hi,
I have tried to paste "<A href="[=Link3]" target=_self>Read</A><BR>" to telerik editor in firexfox on Mac machine from notepad. When i paste this in telerik editor it converts it to "<A href="%5B=Link3%5D" target=_self>Read</A><BR>" . Please note the highlighted part of the text. Please help me on this.

Thanks,
Abhinandan Bansal

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 23 Mar 2012, 11:22 AM
Hello,

This is a browser behavior, which I was able to avoid using the following JavaScript code:

<telerik:RadEditor ID="RadEditor1" runat="server" OnClientPasteHtml="OnClientPasteHtml">
    <Content>
       <A href="[=Link3]" target=_self>Read</A><BR>
    </Content>
</telerik:RadEditor>
<script type="text/javascript">
    function OnClientPasteHtml(sender, args) {
        var commandName = args.get_commandName();
        var content = args.get_value();
 
        if (commandName == "Paste") {
            re = /%5B/gi
            re1 = /%5D/gi
            content = content.replace(re, "[").replace(re1, "]");
            args.set_value(content);  //set the modified pasted content in the editor
        }
    }
</script>

Another approach to solve it is by implementing a custom content filter.

Best regards,
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
Abhinandan Bansal
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or