I'm very new to FCKEditor, and so far I like what I see.
But I'm having a problem in that the Javascript call to GetXHTML() is submitting my form. That's not what I want, and I'm trying to figure out whether this is the result of an error I've made or the expected behavior of FCKEditor. And if it's the latter, I'm wondering if there is a way to change it.
I'm using FCKEditor (2.6 Beta 1, build 18219) only as a simple editor, not really connected directly with any back end, or at least I'm trying to. On an existing page, I have a number of fields that are editable. They are displayed as plain HTML, but with a little icon that when clicked replaces the display value with an edit field, usually a text box or a select list. That edit field is followed by OK, and Cancel buttons. On Cancel, the display field is re-shown and the edit field (and buttons) are hidden. On OK, the value from the edit field replaces the display field, and page-wide Save and Cancel buttons are shown and highlighted. This works fine for all my simple edit fields. But for the textarea that's been replaced by an FCKEditor, I try to call editor.GetXHTML() to update the display field. In that call, my form is submitted to the server. It is submitted correctly with the changed data, but I really would like to be more in control of this. The user should be able to edit all the fields and then choose to Save or Cancel.
The only change I've made to the the configuration is to define a fairly minimal toolbar. My code looks like this:
(contextPath was previously set in another <script> tag by my Java application.)
In the click handler of my OK button, I have the following:
and on that GetXHTML() call, my form is submitted. Is this the normal behavior of FCKEditor, or am I doing something wrong?
Thanks for any help you can offer,
-- Scott Sauyet
But I'm having a problem in that the Javascript call to GetXHTML() is submitting my form. That's not what I want, and I'm trying to figure out whether this is the result of an error I've made or the expected behavior of FCKEditor. And if it's the latter, I'm wondering if there is a way to change it.
I'm using FCKEditor (2.6 Beta 1, build 18219) only as a simple editor, not really connected directly with any back end, or at least I'm trying to. On an existing page, I have a number of fields that are editable. They are displayed as plain HTML, but with a little icon that when clicked replaces the display value with an edit field, usually a text box or a select list. That edit field is followed by OK, and Cancel buttons. On Cancel, the display field is re-shown and the edit field (and buttons) are hidden. On OK, the value from the edit field replaces the display field, and page-wide Save and Cancel buttons are shown and highlighted. This works fine for all my simple edit fields. But for the textarea that's been replaced by an FCKEditor, I try to call editor.GetXHTML() to update the display field. In that call, my form is submitted to the server. It is submitted correctly with the changed data, but I really would like to be more in control of this. The user should be able to edit all the fields and then choose to Save or Cancel.
The only change I've made to the the configuration is to define a fairly minimal toolbar. My code looks like this:
editor = new FCKeditor( 'description-edit' ) ; editor.Height = 300; editor.Width = 500; editor.BasePath = contextPath + "js/fckeditor/" ; editor.ToolbarSet = "IFXBasic"; editor.ReplaceTextarea() ;
(contextPath was previously set in another <script> tag by my Java application.)
In the click handler of my OK button, I have the following:
var editor = FCKeditorAPI.GetInstance(self.id); // [ ... ] var value = editor.GetXTHML();
and on that GetXHTML() call, my form is submitted. Is this the normal behavior of FCKEditor, or am I doing something wrong?
Thanks for any help you can offer,
-- Scott Sauyet