Hello again,
I tried what you suggested and for some reason it is not working.
<html>
<head>
<title>Rich Text Editor</title>
<style type="text/css">
.IsButton
{width:22;height:22;margin:0;padding:0;border-width:1px;border-color:#D0E4FC;border-style:solid;}
</style>
<script type="text/JavaScript">
if(typeof Array().splice=='undefined')
{
Array.prototype.splice=function(start, count)
{
for(var i=start; i+count<this.length; i++)
this[i] = this[i+count];
this.length-=count;}
}
var buttonLocks=[];
function isLocked( elem, table )
{
for(var i=0; i<table.length && elem!=table[i]; i++);
return i==table.length ? -1 : i;
}
function mouse_out()
{
var src=event.srcElement;
if( isLocked(src, buttonLocks)==-1 )
if(src.className=="IsButton")
{
window.status="";
src.style.backgroundColor = "#D0E4FC";
src.style.borderTop = "#D0E4FC solid 1px";
src.style.borderRight = "#D0E4FC solid 1px";
src.style.borderLeft = "#D0E4FC solid 1px";
src.style.borderBottom = "#D0E4FC solid 1px";
}
}
function mouse_over()
{
var src=event.srcElement;
if (isLocked(src, buttonLocks)==-1 )
if(src.className=="IsButton")
{
window.status=src.alt;
src.style.backgroundColor = "#D0E4FC";
src.style.borderBottom = "buttonshadow solid 1px";
src.style.borderLeft = "buttonhighlight solid 1px";
src.style.borderRight = "buttonshadow solid 1px";
src.style.borderTop = "buttonhighlight solid 1px";
}
}
function mouse_down() {
var src=event.srcElement, index;
if( (index=isLocked(src, buttonLocks))==-1 )
buttonLocks[buttonLocks.length*]=src;
else
buttonLocks.splice(index, 1);
if(src.className=="IsButton")
{
src.style.backgroundColor = "#D0E4FC";
src.style.borderTop = "buttonshadow solid 1px";
src.style.borderRight = "buttonhighlight solid 1px";
src.style.borderLeft = "buttonshadow solid 1px";
src.style.borderBottom = "buttonhighlight solid 1px";
}
}
function mouse_up()
{
var src=event.srcElement;
if (isLocked(src, buttonLocks)==-1)
if(src.className=="IsButton")
{
src.style.backgroundColor = "#D0E4FC";
src.style.borderBottom = "buttonshadow solid 1px";
src.style.borderLeft = "buttonhighlight solid 1px";
}
}
</SCRIPT>
</head>
<body bgcolor="#D0E4FC">
<script language= "JavaScript" type= "text/javascript" src= "editor.js"
</script>
<form action="save.asp" name="edit" method="POST" id="edit"
onsubmit="return submitForm();">
<center>
<span name="tbar" onmouseover="mouse_over();"
onmousedown="mouse_down();" onmouseup="mouse_up();"
onmouseout="mouse_out();" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;">
<table width="880" bgcolor="#D0E4FC">
<tr>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'bold', '')"><img
src="../../common/images/richtexteditor/bold.gif" class="IsButton"
border="0" width="22" height="22" alt="Vet" title="Bold"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'underline', '')"><img
src="../../common/images/richtexteditor/under.gif" class="IsButton"
border="0" width="22" height="22" alt="Onderlijn"
title="Underline"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'italic', '')"><img
src="../../common/images/richtexteditor/italic.gif" class="IsButton"
border="0" width="22" height="22" alt="Cursief"
title="Italic"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'justifyleft', '')"><img
src="../../common/images/richtexteditor/aleft.gif" class="IsButton"
border="0" width="22" height="22" alt="Links uitlijnen" title="Align
Left"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'justifycenter', '')"><img
src="../../common/images/richtexteditor/center.gif" class="IsButton"
border="0" width="22" height="22" alt="Centraal uitlijnen" title="Align
Center"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'justifyright', '')"><img
src="../../common/images/richtexteditor/aright.gif" class="IsButton"
border="0" width="22" height="22" alt="Rechts uitlijnen" title="Align
Right"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'indent', '')"><img
src="../../common/images/richtexteditor/ileft.gif" class="IsButton"
border="0" width="22" height="22" alt="Indent" title="Indent"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'outdent', '')"><img
src="../../common/images/richtexteditor/iright.gif" class="IsButton"
border="0" width="22" height="22" alt="Outdent"
title="Outdent"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'undo', '')"><img
src="images/undo.gif" class="IsButton" border="0" width="22"
height="22" alt="Undo" title="Undo"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'redo', '')"><img
src="images/redo.gif" class="IsButton" border="0" width="22"
height="22" alt="Redo" title="Redo"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'insertorderedlist', '')"><img
src="../../common/images/richtexteditor/nlist.gif" class="IsButton"
border="0" width="22" height="22" alt="Opsomming met cijfers toevoegen"
title="Numbering"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'insertunorderedlist', '')"><img
src="../../common/images/richtexteditor/blist.gif" class="IsButton"
border="0" width="22" height="22" alt="Opsomming met symbolen
toevoegen" title="Bullets"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'cut', '')"><img
src="../../common/images/richtexteditor/cut.gif" class="IsButton"
border="0" width="22" height="22" alt="Knippen" title="Cut"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'copy', '')"><img
src="../../common/images/richtexteditor/copy.gif" class="IsButton"
border="0" width="22" height="22" alt="Kopieren" title="Copy"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'paste', '')"><img
src="../../common/images/richtexteditor/paste.gif" class="IsButton"
border="0" width="22" height="22" alt="Plakken" title="Paste"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'superscript', '')"><img
src="images/superscript.gif" class="IsButton" border="0" width="22"
height="22" alt="Superscript" title="Superscript"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'subscript', '')"><img
src="images/subscript.gif" class="IsButton" border="0" width="22"
height="22" alt="Subscript" title="SubScript"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'strikethrough', '')"><img
src="images/strikethrough.gif" class="IsButton" border="0" width="22"
height="22" alt="Doorhalen" title="Strikethrough"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'justifyfull', '')"><img
src="images/justifyfull.gif" class="IsButton" border="0" width="22"
height="22" alt="Uitlijnen" title="Justifyfull"></a></td>
<td bgcolor="#D0E4FC" ondragstart="event.returnValue=false;"
onselectstart="event.returnValue=false;"><a href=
"javascript
:editorCommand('content', 'createlink', '')"><img
src="images/justifyfull.gif" class="IsButton" border="0" width="22"
height="22" alt="Link toevoegen" title="CreateLink"></a></td>
</tr>
</table>
</span>
<table width="880" bgcolor="#D0E4FC">
<tr>
<td>
<script language= "JavaScript" type= "text/javascript" >
<!--
function submitForm() {
updateEditor('content');
return true;
}
initiateEditor();
//-->
</script>
<script language= "JavaScript" type= "text/javascript" >
<!--
displayEditor('content', '', 880, 600);
//-->
</script>
</td>
</tr>
<tr>
<td colspan="22" align="center"><input type="submit" name="Submit"
value="Submit"></td>
</tr>
</table>
</center>
</form>
</body>
</html>