Radeditor is stripping tags

6 posts, 0 answers
  1. Daniel Rojas
    Daniel Rojas avatar
    15 posts
    Member since:
    Nov 2009

    Posted 10 Nov 2009 Link to this post

    Hello

    I'm currently running the Rad editor v 4.4.1.0 in a sharepoint environment and I've noticed that if I insert the tags select(dropdown) or <script>(for javascript) that the editor would remove certain attributes or the whole tags.

    Is there any way to work around this issue?
  2. Stanimir
    Admin
    Stanimir avatar
    1654 posts

    Posted 13 Nov 2009 Link to this post

    Hello Daniel,

    You need to set the RadEditor's AllowScripts property to true. In order to do this you should add the following code in the ConfigFile.xml, which is located in the /Program Files/Common Files/Microsoft Shared/web server extensions/wpresources/RadEditorSharePoint/4.x.x.x__1f131a624888eeed/RadControls/Editor
     folder.
    <property name="AllowScripts">true</property>

    If you are using the Editor in WCM scenario, you will also need to set the AllowSpecialTags in the the current page using SharePoint Designer.
    <radE:RadHtmlField id="Content" FieldName="..." runat="server" AllowSpecialTags="true" ></radE:RadHtmlField>


    All the best,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Daniel Rojas
    Daniel Rojas avatar
    15 posts
    Member since:
    Nov 2009

    Posted 19 Jan 2010 Link to this post

    I just tried this, in the lastest version of the editor (5.6.2) and the editor keeps cleaning my html.

    Here is the hmtl code that I would like to publish in my page. The text marked with bold is the one that is getting deleted when I try to publish the page.

        <script type="text/javascript">
    <!--
    function delayer(address){
    var url = ddlResuable.options[ddlResuable.selectedIndex].value
    alert(url);
        window.location = "ddlResuable.options[ddlResuable.selectedIndex].value"
    }
    //-->
    </script>
    <select name="test" onChange="window.location = this.options[this.selectedIndex].value">
    <option value="http://www.yahoo.com">Yahoo2</option>
    <option value="http://www.google.se">Google</option>
    <option value="http://www.sogeti.se">Sogeti</option>
    </select>
  4. Stanimir
    Admin
    Stanimir avatar
    1654 posts

    Posted 19 Jan 2010 Link to this post

    Hi Daniel Rojas,
    If you are using the latest version of RadEditor for MOSS you need to set the AllowScripts property to true in the ConfigFile.xml (this is for webpart scenario).

    For WCM scenario, you will also need to set the AllowSpecialTags and AllowScripts to true in the the current page using SharePoint Designer.
    <telerik:RadHtmlField id="..." FieldName="..." AllowSpecialTags="true" AllowScripts="true" runat="server"></telerik:RadHtmlField>


    Review the following online help article http://www.telerik.com/help/aspnet-ajax/scripts-in-radeditor.html.


    Also you cannot use Javascript in RadEditor in list (list, wiki, blog ...) scenario. There RadEditor does not have control over the presentation view which means that we cannot control the output when it is not in edit mode.

    I tested the provided code and I was able to insert it in webpart scenario. However there was a problem in WCM scenario. When you save the content the name and onCange attributes of the select element are stripped by the MOSS content filters. When you submit the page, MOSS will validate it and automatically make changes if the content is not valid. You can verify this by trying to enter the same content with the original SharePoint rich text editor. We have not been able to find a workaround for this behavior yet.


    Greetings,
    Stanimir
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Kostas Tsigounis
    Kostas Tsigounis avatar
    3 posts
    Member since:
    Mar 2010

    Posted 22 Jul 2011 Link to this post

    Hello Stanimir,

    we are currently using RadEditor 5.7.2.0 with the WCM scenario (using radE:RadHtmlField) and the onchange event attribute is removed when we check-in the moss page, just as described in Daniel's post.

    Does the issue apply on 5.7.2.0?

    Thanks in advance,
    Kostas
  6. Stanimir
    Admin
    Stanimir avatar
    1654 posts

    Posted 25 Jul 2011 Link to this post

    Hi Kostas,

    "onchange event" is removed in all the versions of RadEditor for MOSS. Unfortunately this is a MOSS behavior, which we can not control and there is no known work around for it.


    All the best,
    Stanimir
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top