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

Radeditor is stripping tags

5 Answers 128 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Daniel Rojas
Top achievements
Rank 1
Daniel Rojas asked on 10 Nov 2009, 02:20 PM
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?

5 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 13 Nov 2009, 12:45 PM
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.
0
Daniel Rojas
Top achievements
Rank 1
answered on 19 Jan 2010, 11:11 AM
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>
0
Stanimir
Telerik team
answered on 19 Jan 2010, 12:24 PM
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.
0
Kostas Tsigounis
Top achievements
Rank 1
answered on 22 Jul 2011, 11:24 AM
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
0
Stanimir
Telerik team
answered on 25 Jul 2011, 07:43 AM
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!

Tags
Editor
Asked by
Daniel Rojas
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Daniel Rojas
Top achievements
Rank 1
Kostas Tsigounis
Top achievements
Rank 1
Share this question
or