Firstly an example of disabling the Editor and moving focus to another element. If you don’t move the focus from the editor, it will appear disabled (greyed out) but the user can still type content.
<%@ Register TagPrefix="rtb" Namespace="RichTextBoxControl" Assembly="RichTextBox" %>
<%@ Page language="c#" ValidateRequest="false"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<RTB:RICHTEXTBOX id="RichTextBox1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px"
runat="server"></RTB:RICHTEXTBOX>
<INPUT id="TextBox35" style="Z-INDEX: 102; LEFT: 12px; POSITION: absolute; TOP: 343px"
type="text">
<INPUT style="Z-INDEX: 103; LEFT: 231px; POSITION: absolute; TOP: 343px" onclick="setRichTextBox(true)"
type="button" value="Disable">
<INPUT style="Z-INDEX: 104; LEFT: 359px; POSITION: absolute; TOP: 343px" type="button"
value="Enable" onclick="setRichTextBox(false)"></form>
<script language="javascript">
document.getElementById('TextBox35').focus();
function setRichTextBox(disable)
{
document.frames('RichTextBox1_x5').document.body.disabled =
disable;
if (disable)
{
document.getElementById('TextBox35').focus();
}
else
{
document.frames('RichTextBox1_x5').document.body.focus();
}
}
</script>
</body>
</HTML>
Secondly if you’d like to disable/enable all the Toolbar items client side then implement the following functions –
function disable()
{
// disable RTB and OrthoToolBar dropdowns
var x=document.getElementsByTagName("select")
for (i=0; i<x.length; i++){
x[i].setAttribute('disabled',true);
}
// disable RTB image buttons
var x=document.getElementsByTagName("img")
for (i=0; i<x.length; i++){
x[i].setAttribute('disabled',true);
}
function enable ()
{
// enable RTB and OrthoToolBar dropdowns
var x=document.getElementsByTagName("select")
for (i=0; i<x.length; i++)
{
x[i].setAttribute('disabled',false);
}
// enable RTB image buttons
var x=document.getElementsByTagName("img")
for (i=0; i<x.length; i++)
{
x[i].setAttribute('disabled',false);
}