Hi there,
I am writing an application using JQuery that involves the user selecting an item from a dropdown. Once selected the content for that item is pulled from a DB using AJaX and other fields on the page are populated using the returned XML. The user then edits the content and clicks save.
I am having problems populating the FCKEditor fields dynamically. When using a simple textarea that is simple:
or
How do I do the same with an FCKEditor textarea?
Thanks in advance.
I am writing an application using JQuery that involves the user selecting an item from a dropdown. Once selected the content for that item is pulled from a DB using AJaX and other fields on the page are populated using the returned XML. The user then edits the content and clicks save.
I am having problems populating the FCKEditor fields dynamically. When using a simple textarea that is simple:
<script type="text/javascript"> document.getElementById("myTextArea").value = "blah ... " </script>
or
<script type="text/javascript"> $("#myTextArea").val("blah ... "); </script>
How do I do the same with an FCKEditor textarea?
Thanks in advance.
Re: Changing Content Dynamically using JS/AJaX/JQuery
Unfortunately I'm not sure where you're actually calling this from, but the biggest thing about the fckeditor is it's api and the fact that it uses iframes to display rich content. The best thing you can do is to use the api (http://wiki.fckeditor.net/Developer's_Guide/Javascript_API) to call the insertHTML() function to insert your content. The reason I mentioned the iframes earlier is that depending on where you call the functions you may have to search in the different iframes for the FCKEditor object. Hope this helps and good luck.