Disable the click events to the links inside the rad editor

2 posts, 0 answers
  1. Sambath
    Sambath avatar
    2 posts
    Member since:
    Jul 2013

    Posted 09 Jul 2013 Link to this post

    Hi Team,

    I am using rad editor control in my CMS. In Rad Editor, is there possible to disable the click events to the hyperlinks inside the editor. I need a workaround to resolve this issue. 

    I need it as soon as possible. Any help is appreciated more.

    Thanks,

  2. Ivaylo
    Admin
    Ivaylo avatar
    37 posts

    Posted 11 Jul 2013 Link to this post

    Hello Sambath,

    By default, the hyperlinks in RadEditor's Content Area are not click-able, unless they are opened in a new tab/window using the middle mouse button, the Ctrl button, or the Shift button. However, preventing the execution of the mentioned commands would be impossible due to JavaScript security limitations.

    Nevertheless, in order to get a reference to the anchor tags you can use the following method, for example in the Editor's client load event:
    function OnClientLoad(editor, args) {
        var links = editor.get_contentArea().getElementsByTagName("a");
    }

    Also, please, refer to the following help article illustrating how to attach/detach event handlers: attachEventHandler, which you can use to prevent the default behavior of the hyperlinks.

    Should I have misunderstood your scenario, could you please elaborate a little bit more on it, so that we can provide further feedback?

    Feel free to contact us if you have any other questions.

    Regards,
    Ivaylo
    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