Hi,
I can't speak english very well, also please throw with stones to me.
I have a question related AJAX and the FCKEditor Version2. I have found out how to set requests to a php-Script yesterday. But, I don't know how to "preset" the content of the FCKEditor through AJAX? My first idea was "document.getElementById('FCKeditor1').value" ... was a good idea, but it dosn't work. Have anyone a hint for me?
Do you know a trick, how to preset the content of the Editor by taking a OnClick-Event? I have predefined sentences like "Dear customer", i would like to add with a click on a button or something else.
Unfortunatley i've searched the web, but i can't find any info or hints. Can you help me, please?
Bye
Viiti76
Fri, 11/06/2009 - 18:23
#1
Re: FCKEditor and AJAX
Ok...Continuing from the other post.....since you want the info posted to fckeditor from an external button, not sure if it is possible, but it may be able to be done another way. I say maybe because I have yet to try it but in theory why wouldnt it work. Here goes.....
Have a php file grab the information from the MySQL DB and throw it back in a delimited file like readDB.php would just send back first entry, second entry, third entry etc. then have the fckplugin.js file parse the php file for you and fill in the dropdown information for you dynamically. That way you would be able to use the DB while filling fckeditor with the correct text. I know you are more interested in something outside of fckeditor controlling fckeditor, but I had some issues trying that myself which is why I made what I did in this post... viewtopic.php?f=5&t=15814&p=41852&e=41852 .
Again I have not made anything do this yet, but it is on my calendar as something to try since changing the code when you want to add or remove text from the dropdown is so cumbersome.
I hope that maybe will spark some ideas for you, if you want some more info just ask and I will try to help more,
Larry