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

[Solved] Empty URL brings an access deny error

1 Answer 88 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Avi
Top achievements
Rank 1
Avi asked on 20 Apr 2009, 04:22 AM
Hello,
Im working with the Hyperlink Manager in order to create links. When the Hyperlink manager opens, the URL field has allready the http://  value. If you leave the URL Field as is and try to open the link, you get an access deny java script error.
Is there a way to customize the Hyperlink Manager or is there a special property so it will not allowed to create a link that is not valid?
Can i registaer to the OK button click event that will help me to validate the URL?
Thanks in advanced

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Apr 2009, 02:40 PM
Hello Avi,

You can attach to the OnClientSubmit event property of RadEditor, obtain a reference to all the links in the editor's content area, strip the not valid links and submit the modified content. Here is an example how to attach to the OnClientSubmit event and get reference to the content area with the editor.get_document().body object:

<script  type="text/javascript"
function OnClientSubmit(editor) 
     //get reference to all links in the content area 
     alert(editor.get_document().body.getElementsByTagName("A").length); 
</script> 
 
<telerik:RadEditor id="RadEditor1" runat="server" OnClientSubmit="OnClientSubmit"
    <Content><a href="">test</a></Content> 
</telerik:RadEditor>  
<asp:Button ID="Button1" runat="server" Text="Button" /> 


All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Avi
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or