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

Paragraph Tags changing in RadEditor Q3.

2 Answers 53 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Brete
Top achievements
Rank 1
Brete asked on 02 Mar 2009, 11:23 PM
I am in the process of updating a web application from Q1 2008 to Q3 2008. 

The method text is alignment has changed from <p align... to a <p style="text-align....
In Q1 2008 The Editor  Centered text was rendered and returned as
<p align = "center"> Some Text </p>

In Q3 2008 it is being converted to 

<p style="text-align: center; undefined:">Some Text</p>

Is there a way configure the editor to use the old method of text alignment? 




2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Mar 2009, 05:57 PM
Hi Brete,

The conversion from
<p align = "center"> Some Text </p>
to
<p style="text-align: center;">Some Text</p> 
was implemented to enhance the RadEditor's production of XHTML compliant content.

The <p style="text-align: center; undefined:">Some Text</p> problem was fixed in Q3 SP2 of RadControls for ASP.NET AJAX.

In order to produce the old content with align inline tags, you should attach to the OnClientSubmit event of RadEditor and convert the text-align style attributes to align tags. This event is fired when the content is submitted.

<script type="text/javascript">  
function OnClientSubmit(editor)  
{  
   //go through all elements in the content area  
   var elems = editor.get_document().getElementsByTagName("*");  
   for (var i = 0; i < elems.length; i++)  
   {  
       var elem = elems[i];  
        
       //convert the inline style tags to HTML attributes 
        
   }  
}  
</script>  
  
<telerik:RadEditor runat="server"  
        OnClientSubmit="OnClientSubmit"  
        ImageManager-ViewPaths="~/"  
        ID="RadEditor1">  
</telerik:RadEditor>   
<asp:Button ID="Button1" runat="server" Text="Submit Button" /> 


Best regards,
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.
0
Brete
Top achievements
Rank 1
answered on 03 Mar 2009, 07:04 PM
I was able to get the functionality I wanted by turning disabling the ConvertToXhtml filter. 

Tags
Editor
Asked by
Brete
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Brete
Top achievements
Rank 1
Share this question
or