B
Bob Rivers
Hi,
I'm trying to build a web page where the user can insert text
dinamically. When the user hits a button, a new text box is created and
the user can insert text into it.
It's working nice with Firefox 1.0, but it's not working with IE
6.0.2800.1106 (W2K SP4)
function addText() {
doc = document.getElementById("desktop");
myIframe = document.createElement("iframe");
myIframe.id = "editFrame";
myIframe.name = "editFrame";
myIframe.style.border = "1px dotted";
myIframe.style.position = "relative";
doc.appendChild(myIframe);
if(document.all) {
document.editFrame.document.designMode = 'On';
} else {
document.getElementById("editFrame").contentDocument.designMode =
"on";
}
}
I did a test putting it inside an static page (below) and it worked.
<HTML>
<HEAD></HEAD>
<BODY>
<IFRAME NAME="editFrame"></IFRAME>
<SCRIPT>
document.editFrame.document.designMode = 'On';
</SCRIPT>
</BODY>
</HTML>
So, is it possible to do it on the fly? Any help?
TIA,
Bob
I'm trying to build a web page where the user can insert text
dinamically. When the user hits a button, a new text box is created and
the user can insert text into it.
It's working nice with Firefox 1.0, but it's not working with IE
6.0.2800.1106 (W2K SP4)
function addText() {
doc = document.getElementById("desktop");
myIframe = document.createElement("iframe");
myIframe.id = "editFrame";
myIframe.name = "editFrame";
myIframe.style.border = "1px dotted";
myIframe.style.position = "relative";
doc.appendChild(myIframe);
if(document.all) {
document.editFrame.document.designMode = 'On';
} else {
document.getElementById("editFrame").contentDocument.designMode =
"on";
}
}
I did a test putting it inside an static page (below) and it worked.
<HTML>
<HEAD></HEAD>
<BODY>
<IFRAME NAME="editFrame"></IFRAME>
<SCRIPT>
document.editFrame.document.designMode = 'On';
</SCRIPT>
</BODY>
</HTML>
So, is it possible to do it on the fly? Any help?
TIA,
Bob