I have the following code to replace a textarea with the FCKEditor
var oFCKeditor = new FCKeditor( 'request' ) ;
oFCKeditor.BasePath = "../fckeditor/" ;
oFCKeditor.ToolbarSet = 'londis';
oFCKeditor.ReplaceTextarea() ;
<TEXTAREA id=request name=request ROWS=10 style="width:100%"></TEXTAREA>
which works fine.
how ever when I try to look at the value in the textarea with this javascript
alert(document.getElementById('request').value);
it is always blank is there a way that I can force the FCKEditor to update the underlying textarea or is there a way that I can get the text directly from the fckeditor.
var oFCKeditor = new FCKeditor( 'request' ) ;
oFCKeditor.BasePath = "../fckeditor/" ;
oFCKeditor.ToolbarSet = 'londis';
oFCKeditor.ReplaceTextarea() ;
<TEXTAREA id=request name=request ROWS=10 style="width:100%"></TEXTAREA>
which works fine.
how ever when I try to look at the value in the textarea with this javascript
alert(document.getElementById('request').value);
it is always blank is there a way that I can force the FCKEditor to update the underlying textarea or is there a way that I can get the text directly from the fckeditor.
Re: Textarea is blank
You can do it like this...First make the instance of that TextArea like
var oEditor = FCKeditorAPI.GetInstance('Here You TextArea ID') ;
Then take a variable in Javascript and assign the value of it like
var varText = oEditor.EditorDocument.body.innerHTML;
This is the One way to do this...Another way is you can use the GetData function of the FCKEditor API..That also works for that see the Documentation.
Tell me if this works for you.