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

How to make Links (<a> tag) work in RadEditor?

2 Answers 399 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 19 Dec 2017, 09:32 PM

Hi!

I have a RadEditor on a page and links do not work when clicked.  I read in other posts that the links won't work due to it being rendered in an IFRAME, and try some JavaScript workarounds:

https://www.telerik.com/forums/radeditor-hyperlinks-not-working

 

I tried both of the workarounds mentioned there:

http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/how-to/open-link-in-a-new-window-when-clicked
http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/how-to/open-link-in-a-new-window-on-double-click

But neither was able to open a new page.  I set ContentFilters to "None", and still the same issue so it's not related to that.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 20 Dec 2017, 06:56 AM
Hello Lee,

You can right click over a link and use the Open Link feature of the context menu of RadEditor to open the link. You can test this in the Default demo.

Regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mark
Top achievements
Rank 1
Iron
answered on 19 Jun 2024, 04:37 PM

Still experiencing this issue in 2024.  The workarounds that were linked how-to documents almost worked.  i had to modify the Javascript method slightly, specifically to remove the onclick code that was auto inserted by the RadEditor.

    <script type="text/javascript">
    function OnClientLoad(editor)
    {
        var links = editor.get_document().getElementsByTagName("A");
        for (var i = 0; i < links.length; i++)
        {
            var link = links[i];
            link.setAttribute("target", "_blank");
            link.setAttribute("onclick", "");
        }
    }
    </script>

HTH

-Mark

Tags
Editor
Asked by
Lee
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Mark
Top achievements
Rank 1
Iron
Share this question
or