HI,
I want to know which is the value of the html, so I can use it like this:
• In my popup editor:
<input type="button" name="return_code" id="return_code" onClick='window.opener.document.getElementById("my_input_text_result").value = document.getElementById("FCKeditor1").value' value="Return HTMLCode">
(Which returns me the preview value but not de new one that I'm writing)
• In my mani page:
<input type="text" name="my_input_text_result" id="my_input_text_result" value="" />
Cause y don't want submit the form because it refresh me my main page.
I saw this post but I can't make it works with php:
http://www.fckeditor.net/forums/viewtopic.php?f=6&t=8368&p=22924
var editor = new FCKeditor("test123"); // ... Then later, to get the value var inst = FCKeditorAPI.GetInstance("test123"); var sValue = inst.GetHTML();
Thx in advance for ur help.
Re: Obtain the html value in FKCEditor?
This worked for me.
yourinstancename should be the same name like the id of the textarea you are using to create the editor.
Try to declare the variable for your editor outside of th createEditor function.
Something like:
var oFCKeditor = undefined;
createEditor () {
var sBasePath = 'fckeditor/' ;
oFCKeditor = new FCKeditor( 'yourinstanncename' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.ReplaceTextarea() ;
}
function alertValue() {
if (ofCKeditor != undefined) {
alert(FCKeditorAPI.GetInstance('yourinstanncename').GetData(););
}
}
is supposed to work. Only if the Editor is created an you call alertValue() of course...
Hope I could help.
Re: Obtain the html value in FKCEditor?
I can`t make it works
throw me this error:
Fatal error: Call to a member function GetInstance() on a non-object in C:\wamp\www\myproject\fckeditor\_samples\php\sample03.php on line 78