Is there is any way to launch FCKeditor in popup window, set initial value from some control on opener form, and than update value on opener form when user press "Save" ?
Only acceptable solution found so far - create ASP.NET form with hidden input, set hidden input via javascript to initial value, recreate FCKEditorV2 component on postback, close window and return value via
Body.Attributes.Add("onload","returnValue('"+FCKeditor1.Value+"');");
Two postbacks in row for pure client-side task.
Only acceptable solution found so far - create ASP.NET form with hidden input, set hidden input via javascript to initial value, recreate FCKEditorV2 component on postback, close window and return value via
Body.Attributes.Add("onload","returnValue('"+FCKeditor1.Value+"');");
Two postbacks in row for pure client-side task.
RE: Javascript integration: pop-up window
window.opener.document.forms["myform1"].elements["<?php echo $idChamp; ?>"].value=window.document.forms["edit"].elements["ta"].value;
This is easy with htmlarea because htmlarea pop-up window uses only simple HTML syntax with one form.
However with FCKeditor I tries to do the same thing, but it is not easy because HTML produced by FCKeditor is much more complex and the element value to retrieve is inside a deep overlap of iframes and tables elements.
I think it is around "eWysiwyg", "eWysiwygCell" or "eEditorArea" objets id, but till now I have not found.
Thierry B.
RE: Javascript integration: pop-up window
just found how to write data back, using Javascript API instead:
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
window.opener.document.forms["myform1"].elements["<?php echo $idChamp; ?>"].value=oEditor.GetXHTML( true );
However, I don't succeed to retrieve the data from the textarea into FCKeditor window. In the FCKeditor window I have this :
<body onload="retrieve();">
and normally I should use :
<SCRIPT LANGUAGE="JavaScript">
function retrieve(){
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
oEditor.SetHTML( window.opener.document.forms['myform1'].elements["<?php echo $idChamp; ?>"].value );
}
</SCRIPT>
This works with the sample08.html file, however with my file I get this Javascript error:
Error : oEditor.SetHTML is not a function
It is strange because if I move the 'retrieve()' call from the 'onload' event to a form button (.ie manually retrieve textarea content), it works (sample08.html use a button as well).
Thierry B.
RE: Javascript integration: pop-up window
I even tried to add some javascript code to 'wait' one or two seconds, but this prevents all javascript code to run including fckeditor, so I have to find some javascript code that detects when FCKeditor is ready.
Thierry B.
RE: Javascript integration: pop-up window
how get the edited new value of editor in new window ?