With other HTML editors I've had trouble with people clicking 'save' to submit() then immediately exiting the browser. In this use-case only a small portion of long POST variables are sent to my server-side script, because it simply hasn't had sufficient time to submit.
To get around this in the past I would append a fake tag to the editor contents in a 'save button' onClick Javascript event. I've been unable to do so in CKEditor 3.5.2
Sample code that does not work:
The above produces a blank htmlCode POST variable on the server-side.
The above produces a blank htmlCode POST variable on the server-side.
The only one I've made work is:
However, here I'd need to change all my server-side scripts to look for a different editor-content variable.
What am I doing incorrectly?
Cheers,
Michael
To get around this in the past I would append a fake tag to the editor contents in a 'save button' onClick Javascript event. I've been unable to do so in CKEditor 3.5.2
Sample code that does not work:
var fun = CKEDITOR.instances.htmlCode.getData(); CKEDITOR.instances.htmlCode.setData(fun + "hello world");
The above produces a blank htmlCode POST variable on the server-side.
CKEDITOR.instances.htmlCode.setData(CKEDITOR.instances.htmlCode.getData() + "hello world");
The above produces a blank htmlCode POST variable on the server-side.
The only one I've made work is:
var fun = CKEDITOR.instances.htmlCode.getData(); document.getElementByID('some_hidden_variable').value = fun + "hello world";
However, here I'd need to change all my server-side scripts to look for a different editor-content variable.
What am I doing incorrectly?
Cheers,
Michael
Re: append custom tags
However, the above is an ajax post. I'd like to make this work in the existing save_button onClick framework that I have for "regular" document.submit() events.