viewtopic.php?f=6&t=10236&start=0&st=0&sk=t&sd=a
http://www.ingenuity.be/test/
WHAT YOU WILL NOTICE:
-the changes you made to the textfield work fine
-the changes you made in the editor DO NOT WORK,... (value will always be "blabla" for some reason)
Can somebody tell me why? Can somebody help me by telling me where I should search in my code to get this solved? Any suggestions would be much appreciated, thanks in advance.
http://www.ingenuity.be/test/
WHAT YOU WILL NOTICE:
-the changes you made to the textfield work fine
-the changes you made in the editor DO NOT WORK,... (value will always be "blabla" for some reason)
Can somebody tell me why? Can somebody help me by telling me where I should search in my code to get this solved? Any suggestions would be much appreciated, thanks in advance.
<html> <head> <title>test</title> <script src="dojo/dojo.js" type="text/javascript" djConfig="parseOnLoad: false, isDebug: false"></script> <script src='FCKeditor/fckeditor.js' type='text/javascript'></script> <script src="myJavaScript.js" type='text/javascript'></script> </head> <body> <a href="javascript:get_form()">Get the form</a> <div id='form_goes_here'> form goes here </div> <div id='editor'></div> <div id='post_data_goes_here'> post data goes here </div> </body> </html>
<form name='testform' id='testform'> <input type='text' name='test' id='test' value='bla'><br /> <textarea name='FCKeditor1' id='FCKeditor1'>blabla</textarea><br /> <input type='button' name='click' id='click' value='click' onClick="submit_form();" /> </form>
<pre> <?php var_dump($_POST); ?> </pre>
function createEditor()
{
FCKeditorAPI = null;
__FCKeditorNS = null;
var oFCKeditor = new FCKeditor( 'FCKeditor1' );
oFCKeditor.BasePath = "FCKeditor/";
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '545' ;
oFCKeditor.ToolbarSet = 'Default' ;
oFCKeditor.ReplaceTextarea();
}
function get_form() {
document.getElementById("editor").innerHTML = "";
dojo.xhrGet( {
preventCache:true,
url: "form.php",
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dojo.byId("form_goes_here").innerHTML = response ;
return response;
},
error: function(response, ioArgs) {
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
});
setTimeout ("createEditor()", 1000);
}/*get_form*/
function submit_form() {
dojo.xhrPost ({
url: "process.php",
handleAs: "text",
load: function(response, ioArgs) {
dojo.byId("post_data_goes_here").innerHTML = response ;
return response;
},
// Name of the Form we want to submit
form: 'testform',
// Call this function if an error happened
error: function (error) {
console.error ('Error: ', error);
}
});
}
Re: content changes in the editor DO NOT GET SUBMITTED,...
maybe you better close form tag after <div id="editor"></div>, not before?
Re: content changes in the editor DO NOT GET SUBMITTED,...
Also, your setTimeout(1000) isn't very reliable. If it takes DOJO more than a second to initialize, the editor won't find the textarea. It's better to initialize the editor after DOJO is done (on some kind of a completion callback).
Re: content changes in the editor DO NOT GET SUBMITTED,...
http://blogs.uct.ac.za/blog/lovemores-world/2008/10/27/post-fckeditor-form-with-ajax-solved