Home / Community & Support / Knowledge Base / RadControls for ASP.NET AJAX / Editor / Disabling HTML editing in Html mode of RadEditor

Disabling HTML editing in Html mode of RadEditor

Article Info

Rating: Not rated

Article information

Article relates to

 RadEditor for ASP.NET AJAX
 Telerik.Web.UI (v.2008.1.415+)  

Created by

 Rumen Zhekov, Telerik


HOW-TO
Disable HTML editing in Html mode of RadEditor

SOLUTION
In specific scenarios, the user should be able to see the HTML content but not able to edit it. The code below demonstrates how to disable the editor's HTML content area when switching to Html mode and preview HTML content only.

<script type="text/javascript">  
function OnClientLoad(editor, args)  
{  
   editor.add_modeChange(function(editor, args)  
   {  
       var mode = editor.get_mode();                       
       if (mode == 2)  
       {  
          var htmlMode = editor.get_textArea();  //get a reference to the Html mode textarea
          htmlMode.disabled = "true";  
       }  
   });    
}  
</script> 
<telerik:radeditor runat="server" OnClientLoad="OnClientLoad" ID="RadEditor1"></telerik:radeditor>  


Comments

There are no comments yet.
If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.