Hi
I have looked everywhere to solve this problem but still haven't found a solution that works. Is it possible to update the editor's textarea using javascript. This what I have done so far:
1) Extracted Beta 2 to a folder on my c drive called fckeditor.
2) Went to c:\fckeditor\_samples\html\sample01.html and doubled clicked it to run it.
3) This sample editor run with no problems on my WinXP / IE 6 system.
4) I then opened up sample01.html and added <input type="button" value="Insert" onclick="insertContent()"> after the submit button.
5) and also added :
<script type="text/javascript">
function insertContent()
{
var myContent = "Hello World";
}
</script>
in the HEAD section.
6) What I need now is the magic javascript code to insert myContent into the textarea?
Note: I have changed nothing else in the default installation (unzipping) of the beta 2 download.
Thanks in advance
Mark
I have looked everywhere to solve this problem but still haven't found a solution that works. Is it possible to update the editor's textarea using javascript. This what I have done so far:
1) Extracted Beta 2 to a folder on my c drive called fckeditor.
2) Went to c:\fckeditor\_samples\html\sample01.html and doubled clicked it to run it.
3) This sample editor run with no problems on my WinXP / IE 6 system.
4) I then opened up sample01.html and added <input type="button" value="Insert" onclick="insertContent()"> after the submit button.
5) and also added :
<script type="text/javascript">
function insertContent()
{
var myContent = "Hello World";
}
</script>
in the HEAD section.
6) What I need now is the magic javascript code to insert myContent into the textarea?
Note: I have changed nothing else in the default installation (unzipping) of the beta 2 download.
Thanks in advance
Mark
RE: Javascript Push text into Editor Challenge
FCK.InsertHtml(html);
this inserts 'html' into current cursor position, and deletes selection if something is selected.
RE: Javascript Push text into Editor Challenge
I now have
<script type="text/javascript">
function insertContent()
{
var myContent = "Hello World";
FCK.InsertHtml(html);
}
</script>
in my sample01.html and get an FCK is undefined. (I kind of knew that would happen, but I just had to satisfy to you all that I would be stupid enough to just paste in that code in my function call.
I have seen this FCK.InsertHtml(html); in the forum and have tried to get it to work before. So please, I won't be offended if you treat me like a moron, but one line answers like FCK.InsertHtml(html) mean nothing to me. Now, have we another challenger!!
Mark
RE: Javascript Push text into Editor Challenge
<script type="text/javascript">
function insertContent()
{
var myContent = "Hello World";
FCK.InsertHtml(myContent);
}
</script>
Mark
RE: Javascript Push text into Editor Challenge
window.frames[0].FCK.InsertHtml(myContent);
RE: Javascript Push text into Editor Challenge
Thank you for your help. I have got it to work now.
Mark
Re: Javascript Push text into Editor Challenge
thanks "hernux".