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

[Solved] Disable the click events to the links inside the rad editor

1 Answer 158 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sambath
Top achievements
Rank 1
Sambath asked on 09 Jul 2013, 04:39 PM
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,

1 Answer, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 11 Jul 2013, 04:30 PM
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.
Tags
Editor
Asked by
Sambath
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Share this question
or