Hello,
This text area also not editable. The user with the permission to compose can't type in as shown in the attachment.
A full text area code is also attached as notepad file. Because i couldn't save the post due to being too long
What could be the problem?
The code is below;
<td><select name="ref" value= >
<option >In Reply to :</option>
<option >RE:</option>
<option >Reference :</option>
</select><input type=text size=37 name=reference value=></td></tr>
<tr><td><b>Body :</b></td></tr></table>
<table width="100%" border=0 cellspacing=1 cellpadding=0>
<tr>
<td class="default">
<script language="JavaScript">
bLoad=false
pureText=true
bodyTag="<BODY MONOSPACE STYLE=\"font:10pt arial,sans-serif\">"
bTextMode=false
public_description=new Editor
function Editor() {
this.put_html=SetHtml;
this.get_html=GetHtml;
this.put_text=SetText;
this.get_text=GetText;
this.CompFocus=GetCompFocus;
}
function GetCompFocus() {
Composition.focus();
}
function GetText() {
return Composition.document.body.innerText;
}
function SetText(text) {
text = text.replace(/\n/g, "<br>")
Composition.document.body.innerHTML=text;
}
function GetHtml() {
if (bTextMode)
return Composition.document.body.innerText;
else {
cleanHtml();
cleanHtml();
return Composition.document.body.innerHTML;
}
}
function SetHtml(sVal) {
if (bTextMode) Composition.document.body.innerText=sVal;
else Composition.document.body.innerHTML=sVal;
}
var YInitialized = false;
function document.onreadystatechange(){
if (YInitialized) return;
YInitialized = true;
var i, s, curr;
// Find all the toolbars and initialize them.
for (i=0; i<document.body.all.length; i++) {
curr=document.body.all[i];
if (curr.className == "Btn" && !InitBtn(curr))
alert("Toolbar: " + curr.id + " failed to initialize. Status: false");
}
Composition.document.open()
Composition.document.write(bodyTag);
Composition.document.close()
Composition.document.designMode="On"
SetHtml(prepareletter.body1.value);
}
// Initialize a button ontop of toolbar
function InitBtn(btn) {
btn.onmouseover = BtnMouseOver;
btn.onmouseout = BtnMouseOut;
btn.onmousedown = BtnMouseDown;
btn.onmouseup = BtnMouseUp;
btn.ondragstart = YCancelEvent;
btn.onselectstart = YCancelEvent;
btn.onselect = YCancelEvent;
btn.YUSERONCLICK = btn.onclick;
btn.onclick = YCancelEvent;
btn.YINITIALIZED = true;
return true;
}
// Hander that simply cancels an event
function YCancelEvent() {
event.returnValue=false;
event.cancelBubble=true;
return false;
}
// Toolbar button onmouseover handler
function BtnMouseOver() {
if (event.srcElement.tagName != "IMG") return false;
var image = event.srcElement;
var element = image.parentElement;
// Change button look based on current state of image.- we don't actually have chaned image
// could be commented but don't remove for future extension
if (image.className == "Ico") element.className = "BtnMouseOverUp";
else if (image.className == "IcoDown") element.className = "BtnMouseOverDown";
event.cancelBubble = true;
}
// Toolbar button onmouseout handler
function BtnMouseOut() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
yRaisedElement = null;
element.className = "Btn";
image.className = "Ico";
event.cancelBubble = true;
}
// Toolbar button onmousedown handler
function BtnMouseDown() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
event.returnValue=false;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
element.className = "BtnMouseOverDown";
image.className = "IcoDown";
event.cancelBubble = true;
event.returnValue=false;
return false;
}
// Toolbar button onmouseup handler
function BtnMouseUp() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
element.className = "BtnMouseOverUp";
image.className = "Ico";
event.cancelBubble = true;
return false;
}
// Check if toolbar is being used when in text mode
function validateMode() {
if (! bTextMode) return true;
alert('Please uncheck the "View source HTML" checkbox to use the tool bars');
Composition.focus();
return false;
}
function sendHtml(){
if(bTextMode){
document.Compose.body1.value = public_description.get_text();
return true;
}
else{
document.Compose.body1.value = public_description.get_html();
return true;
}
}
//Formats text in composition.
function formatC(what,opt) {
if (!validateMode()) return;
if (opt=="removeFormat") {
what=opt;
opt=null;
}
if (opt==null) Composition.document.execCommand(what);
else Composition.document.execCommand(what,"",opt);
pureText = false;
Composition.focus();
}
//Switches between text and html mode.
function setMode(newMode) {
bTextMode = newMode;
var cont;
if (bTextMode) {
cleanHtml();
cleanHtml();
cont=Composition.document.body.innerHTML;
Composition.document.body.innerText=cont;
} else {
cont=Composition.document.body.innerText;
Composition.document.body.innerHTML=cont;
}
Composition.focus();
}
//Finds and returns an element.
function getEl(sTag,start) {
while ((start!=null) && (start.tagName!=sTag)) start = start.parentElement;
return start;
}
function createLink() {
if (!validateMode()) return;
var isA = getEl("A",Composition.document.selection.createRange().parentElement());
var str=prompt("Tapez une adresse URL:", isA ? isA.href : "http:\/\/");
if ((str!=null) && (str!="http://")) {
if (Composition.document.selection.type=="None") {
var sel=Composition.document.selection.createRange();
sel.pasteHTML("<A HREF=\""+str+"\">"+str+"</A> ");
sel.select();
}
else formatC("CreateLink",str);
}
else Composition.focus();
}
function instable() {
window.open('table.htm','InsertTable','width=450,height=250');
}
function insertTable(rows,cols,attrs){
var str;
str="<table "+ attrs +">";
for(i=0;i<rows;i++){
str+="<tr>";
for(j=0;j<cols;j++)
str+="<td> </td>";
str+="</tr>";
}
str+="</table>"
var sel=Composition.document.selection.createRange();
sel.pasteHTML(str);
sel.select();
}
//Sets the text color.
/*function foreColor() {
//alert("i am in forecolor");
if (! validateMode()) return;
var arr = showModalDialog("/ym/ColorSelect?3", "", "font-family:Verdana; font-size:12; dialogWidth:30em; dialogHeight:35em");
if (arr != null) formatC('forecolor', arr);
else Composition.focus();
}
//Sets the background color.
function backColor() {
//alert("i am in backcolor");
if (!validateMode()) return;
var arr = showModalDialog("/ym/ColorSelect?3", "", "font-family:Verdana; font-size:12; dialogWidth:30em; dialogHeight:35em");
if (arr != null) formatC('backcolor', arr);
else Composition.focus()
}
*/
function cleanHtml() {
var fonts = Composition.document.body.all.tags("FONT");
var curr;
for (var i = fonts.length - 1; i >= 0; i--) {
curr = fonts[i];
if (curr.style.backgroundColor == "#ffffff") curr.outerHTML = curr.innerHTML;
}
}
function getPureHtml() {
var str = "";
var paras = Composition.document.body.all.tags("P");
if (paras.length > 0) {
for (var i=paras.length-1; i >= 0; i--) str = paras[i].innerHTML + "\n" + str;
} else {
str = Composition.document.body.innerHTML;
}
return str;
}
function doUpload(pictureName) {
if (!validateMode()) return;
var sel=Composition.document.selection.createRange();
sel.pasteHTML("<IMG SRC="+pictureName+">");
sel.select();
}
</script>
<div id="plainmsg" style='visibility:hidden;position:absolute;top:0px;left:0px'>
</div>
What could be the problem?
Your help will be highly appreciated
Thank you
Ronnie