PDA

View Full Version : HELP !! Spry submit with TinyMCE/FCKeditor


TimAllmark
08-26-2008, 12:36 PM
Can anyone help me?

The setup is a basic CMS using TinyMCE. I select the page I wish to edit and the correct content is loaded into the editor.

Can anyone tell me why when using the following script to submit the form containing the text editor, (either TinyMCE or FCKeditor) the first time you submit it sends the contents prior to editing, and only by submitting the form again will the updates be saved. The upshot being I have to hit submit on the form twice before the edits are saved

Here is the code for the form:

<form method="post" action="#application.myself##xfa.cms_save#" id="text_editor" name="text_editor" onsubmit="return Spry.Utils.submitForm(this, updateResponseDiv)">
<cfif isDefined('attributes.page')>
<input name="page_loc" type="hidden" value="#attributes.page#" />
</cfif>
<textarea name="content" cols="70" rows="20">
<cfif NOT isDefined('admin_cms_content')>
Please select a page.
<cfelse>
#admin_cms_content#
</cfif>
</textarea>
<br />
<cfif isDefined('attributes.page')>
<input type="submit" value="Save" />
</cfif>
</form>

Any help would be grateful as this has bugged me for a while now.

Cheers

Tim

edbr
08-27-2008, 01:03 AM
if the page containing the submit form has connection to the tinymice ( or FCK) you should have the editing buttons below the form fields.
for ie, in the head,
<!-- tinyMCE -->
<script language="javascript" type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
// Notice: The simple theme does not use all options some of them are limited to the advanced theme
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</script>
<!-- /tinyMCE -->

TimAllmark
08-27-2008, 10:59 AM
I have the following code in the head of the page:

<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced"
});
</script>

I think it has something to do with the spry submit as I had the same problem with FCK. And i'm just submiting the form via the standard form "submit" button. As you can see from the code I have the advanced toolset below the editor window.

Cheers

Tim