Disable Anchor Tag in RadEditor

4 posts, 0 answers
  1. nsrikanth 2009
    nsrikanth 2009 avatar
    39 posts
    Member since:
    Apr 2010

    Posted 29 Feb 2012 Link to this post

    hi

    if user enter any url like www.google.com  in Radeditor it is getting anchor tag in html view.how to disable this one.

    Thanks and Regards
    Srikanth
    <telerik:RadEditor ID="txtMessage" runat="server" Height="200px" Width="470px" Skin="Office2007"
                                                                        DialogHandlerUrl="Telerik.Web.UI.DialogHandler.axd" TabIndex="3" OnClientLoad="OnClientLoad"
                                                                        ContentFilters="MakeUrlsAbsolute,FixEnclosingP,IECleanAnchors "  >
                                                                        <RealFontSizes>
                                                                            <telerik:EditorRealFontSize Value="1pt" />
                                                                            <telerik:EditorRealFontSize Value="2pt" />
                                                                            <telerik:EditorRealFontSize Value="3pt" />
                                                                            <telerik:EditorRealFontSize Value="4pt" />
                                                                            <telerik:EditorRealFontSize Value="5pt" />
                                                                            <telerik:EditorRealFontSize Value="6pt" />
                                                                            <telerik:EditorRealFontSize Value="7pt" />
                                                                            <telerik:EditorRealFontSize Value="8pt" />
                                                                            <telerik:EditorRealFontSize Value="9pt" />
                                                                            <telerik:EditorRealFontSize Value="10pt" />
                                                                            <telerik:EditorRealFontSize Value="11pt" />
                                                                            <telerik:EditorRealFontSize Value="12pt" />
                                                                            <telerik:EditorRealFontSize Value="13pt" />
                                                                        </RealFontSizes>
                                                                        <Tools>
                                                                            <telerik:EditorToolGroup>
                                                                                <telerik:EditorTool Name="FindAndReplace" />
                                                                                <telerik:EditorSeparator />
                                                                                <telerik:EditorTool Name="Undo" />
                                                                                <telerik:EditorTool Name="Redo" />
                                                                                <telerik:EditorSeparator />
                                                                                <telerik:EditorTool Name="Cut" />
                                                                                <telerik:EditorTool Name="Copy" />
                                                                                <telerik:EditorTool Name="Paste" />
                                                                            </telerik:EditorToolGroup>
                                                                            <telerik:EditorToolGroup>
                                                                                <telerik:EditorTool Name="Bold" />
                                                                                <telerik:EditorTool Name="Italic" />
                                                                                <telerik:EditorTool Name="Underline" />
                                                                                <telerik:EditorSeparator />
                                                                                <telerik:EditorTool Name="ForeColor" />
                                                                                <telerik:EditorTool Name="BackColor" />
                                                                                <telerik:EditorSeparator />
                                                                                <telerik:EditorTool Name="FontName" />
                                                                                <telerik:EditorTool Name="RealFontSize" />
                                                                            </telerik:EditorToolGroup>
                                                                        </Tools>
                                                                       
                                                                    </telerik:RadEditor>
  2. Rumen
    Admin
    Rumen avatar
    14361 posts

    Posted 29 Feb 2012 Link to this post

    Hello,

    This IE browser feature could be disabled in IE9 only. You can do that using the following code:

    Copy Code

    <script type="text/javascript">
    function OnClientLoad(editor) {
      editor.get_document().execCommand("AutoUrlDetect", false, false)
    }
    </script>
    <telerik:RadEditor runat="server" ID="RadEditor" OnClientLoad="OnClientLoad"></telerik:RadEditor>

    You can find more information about the AutoUrlDetect property of IE9 in the following MSDN blog:
    http://blogs.msdn.com/b/ieinternals/archive/2010/09/15/ie9-beta-minor-change-list.aspx


    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.
  3. nsrikanth 2009
    nsrikanth 2009 avatar
    39 posts
    Member since:
    Apr 2010

    Posted 16 Mar 2012 Link to this post

    hi

    sorry for delay, it is not working 

    Invalid argument js Error


    Browser :IE8
    OS:Windows 7
  4. Rumen
    Admin
    Rumen avatar
    14361 posts

    Posted 20 Mar 2012 Link to this post

    Hello,

    As I already noted the solution is IE9 specific only and you should execute the
    editor.get_document().execCommand("AutoUrlDetect", false, false)
    function in IE9 only, e.g.

    <script type="text/javascript">
        function OnClientLoad(editor) {
            if ($telerik.isIE9Mode) {
                editor.get_document().execCommand("AutoUrlDetect", false, false);
            }
        }
    </script>
    <telerik:RadEditor runat="server" ID="RadEditor" OnClientLoad="OnClientLoad"></telerik:RadEditor>


    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.
Back to Top