Hi all,
I know there is some examples in the archives of how to retrieve the contents of the editor via JS but I can't get them to work. It could be because the examples are for an older version (I'm using 2.0b2) or because of the situation I'm using it in (I'm testing with FF1.0 as well).
Basically the page is displayed with the editor, if the user hits the "detach" button, the page is displayed in a popup window. If the "detach" url variable is present, my ColdFusion script will write out some onLoad JS which sets the field values to the values of the fields in the "opener" object.
So it looks something like:
<cfif IsDefined("url.detatch")>
<script language="javascript">
function TransferData() {
if(opener.document.getElementById('field1''))
document.getElementById('field1').value = opener.document.getElementById('field1').value;
if(opener.document.getElementById('field2))
document.getElementById('field2').value = opener.document.getElementById('field2).value;
if(opener.document.forms[0].document.objContent.DOM.body.innerHTML)
document.forms[0].document.objContent.DOM.body.innerHTML =opener.document.forms[0].document.objContent.DOM.body.innerHTML;
}
</script>
</cfif>
Does it make sense what I'm trying to do here?
Regards,
Jon
I know there is some examples in the archives of how to retrieve the contents of the editor via JS but I can't get them to work. It could be because the examples are for an older version (I'm using 2.0b2) or because of the situation I'm using it in (I'm testing with FF1.0 as well).
Basically the page is displayed with the editor, if the user hits the "detach" button, the page is displayed in a popup window. If the "detach" url variable is present, my ColdFusion script will write out some onLoad JS which sets the field values to the values of the fields in the "opener" object.
So it looks something like:
<cfif IsDefined("url.detatch")>
<script language="javascript">
function TransferData() {
if(opener.document.getElementById('field1''))
document.getElementById('field1').value = opener.document.getElementById('field1').value;
if(opener.document.getElementById('field2))
document.getElementById('field2').value = opener.document.getElementById('field2).value;
if(opener.document.forms[0].document.objContent.DOM.body.innerHTML)
document.forms[0].document.objContent.DOM.body.innerHTML =opener.document.forms[0].document.objContent.DOM.body.innerHTML;
}
</script>
</cfif>
Does it make sense what I'm trying to do here?
Regards,
Jon
RE: JS: Retrieve active editor contents
Anyone with a clue on this issue?