Hi,
I recently tried implementing fckeditor and I ran into some problems. I use the editor in a form, but when submitting, just the default text is submitted. I read that this would be because, the page is not refreshed, and so the text isn't loaded into the hidden textarea. So I tried using the UpdateLinkedField, but this didn't work either. I use the method posted in the wiki on the troubleshoot page.
Now I tried to use the isDirty() function of FCK, to see if that would work, and here Firebug told me that isDirty() is not a function. However it doesn't give that error when calling UpdateLinkedField.
I don't know why, but I have the idea that it is because I load fckeditor dynamically. By this I mean, that my website consists of a layout, and in this layout, the content is loaded dynamically (with ajax). This means fckeditor isn't loaded when the page loads. So I think the javascript that fckeditor needs isn't loaded completely. But that is just a theory.
Does anyone have any experience with a problem like this, or does anyone have a solution?
EDIT: Here's the code for the content (not the lay-out).
I recently tried implementing fckeditor and I ran into some problems. I use the editor in a form, but when submitting, just the default text is submitted. I read that this would be because, the page is not refreshed, and so the text isn't loaded into the hidden textarea. So I tried using the UpdateLinkedField, but this didn't work either. I use the method posted in the wiki on the troubleshoot page.
function UpdateEditorFormValue() { for ( i = 0; i < parent.frames.length; ++i ){ if ( parent.frames[i].FCK ){ parent.frames[i].FCK.UpdateLinkedField(); } } }
Now I tried to use the isDirty() function of FCK, to see if that would work, and here Firebug told me that isDirty() is not a function. However it doesn't give that error when calling UpdateLinkedField.
I don't know why, but I have the idea that it is because I load fckeditor dynamically. By this I mean, that my website consists of a layout, and in this layout, the content is loaded dynamically (with ajax). This means fckeditor isn't loaded when the page loads. So I think the javascript that fckeditor needs isn't loaded completely. But that is just a theory.
Does anyone have any experience with a problem like this, or does anyone have a solution?
EDIT: Here's the code for the content (not the lay-out).
<?php require_once("../fckeditor/fckeditor.php"); ?> <h3>Shelter beheer</h3> <blockquote> Op deze pagina kan het shelter archief worden beheerd. Het voorwoordje en redactioneeltje kunnen worden aangepast en shelters kunnen worden gedelete, ander editienummer gegeven of verplaatst. <p><br> <b><a href="javascript:show('grl')">Voorwoordje Groepsleiding bewerken</a></b> <p> <div id="grl" class="invisible"> <form method="POST" action="shelter/update.php?a=voorwoord" id="updatevoorwoord" name="updatevoorwoord"> <?php $oFCKeditor = new FCKeditor('inhoud') ; $oFCKeditor->BasePath = 'fckeditor/' ; $oFCKeditor->Value = 'Voorwoord' ; $oFCKeditor->Create() ; ?><br> <input type="button" value="Update!" onclick="UpdateEditorFormValue();submitForm(this.form.name)"><br> <a href="javascript:hide('grl')">Verstop</a> </form> </div> </p> <p><b><a href="javascript:show('red')">Redactioneeltje bewerken</a></b> <p> <div id="red" class="invisible"> <form method="POST" action="shelter/update.php?a=redactioneel" id="updateredactioneel" name="updateredactioneel"> <?php $oFCKeditor2 = new FCKeditor('inhoud') ; $oFCKeditor2->BasePath = 'fckeditor/' ; $oFCKeditor2->Value = 'Redactioneel' ; $oFCKeditor2->Create() ; ?><input type="button" value="Update!" onclick="UpdateEditorFormValue();submitForm(this.form.name)"><br> <a href="javascript:hide('red')">Verstop</a> </form> </div> </p> </blockquote>