This post is for people who have some experience with the FCKEditor and
are aware of the quirks of the latest version. OR, for JS gurus who
would be interested in figuring it out.
There is a new version of the free FCKEditor (fckeditor.com) and the
pages I've been using broke after I upgraded.
What I am trying to do is upgrade an implementation using the older
version to the new version as it supports mozilla.
the functionality is as follows:
main editing page (p.A) contains a textarea and a link which opens a
popup (p.B) with an instance of tfckeditor. the popup takes the value
of p.A.textarea and inserts it in the fckeditor area (oFCKeditor.Value
= opener.document.form1.<%=parentField%>.value
after editing the contents of the popup window, the user clicks on
"save" button which passes the fckeditor value to the parent and closes
the popup
opener.document.form1.<%=parentField%>.value=docum ent.frames[0].objContent.DOM.body.innerHTML;
window.close();
How do I do this last part with version 2.0 of the FCKEditor?
document.frames[0].objContent.DOM.body.innerHTML does not seem to exist
in version 2.0.
Thank you in advance!
-- Andre
here's the code in more detail ---------------------------------
<form action="" method="post" name="frm_editor" id="frm_editor"
language="javascript">
<SCRIPT language="javascript">
var sBasePath = "/stage/_admin/FCKEditor/";
oFCKeditor = new FCKeditor('txtEditor') ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.Width = '610' ;
oFCKeditor.Height = '550' ;
oFCKeditor.ToolbarSet = 'AccessibilityNoImages' ;
oFCKeditor.Value = opener.document.form1.<%=parentField%>.value;
oFCKeditor.CanUpload = false ;
oFCKeditor.CanBrowse = false ;
oFCKeditor.Create() ;
</SCRIPT>
<!-- THE CODE BELOW used to work for the old version and I am trying to
find an equivalent for the new version. -->
<INPUT name="Button3" type="button"
onclick="opener.document.form1.<%=parentField%>.va lue=document.frames[0].objContent.DOM.body.innerHTML;
window.close(); " value="Save Changes">
I was given the suggestion to use
document.frm_editor.txtEditor.value
but this value keeps the initial value of the editor's content area and
does not reflect any changes made to the content. I can delete
everything in the content area or add text, but this value always
returns the initial contents assigned to oFCKeditor.Value.