Hi there,
When I paste some code in CKEditor and click the code button again to go back to the design mode it automatically corrects/ cleans up the code I just pasted.
But when I just submit the code withought clicking the code button again first it doesn't correct the code. Some code that I pasted was so buggy that I lost all data from one of my tables.
Now I want to do one of the following things but I have no idea how:
- Execute this cleanup function on submit
- Check if the user is still working in the source code to block a submit attempt
When I paste some code in CKEditor and click the code button again to go back to the design mode it automatically corrects/ cleans up the code I just pasted.
But when I just submit the code withought clicking the code button again first it doesn't correct the code. Some code that I pasted was so buggy that I lost all data from one of my tables.
Now I want to do one of the following things but I have no idea how:
- Execute this cleanup function on submit
- Check if the user is still working in the source code to block a submit attempt

Re: Inserting code problem
function updateCke() { for (i in CKEDITOR.instances) { CKEDITOR.instances[i].updateElement(); } }then add the function to the onSubmit event handler of the form.
Thanks,
Zanpakutō
Re: Inserting code problem
I tried to use the function you gave me, but I couldn't get it to work.
The data gets saved the same like it normaly would. If I just call the function withought submitting the form it doens't do anything eighter. I dont even get an error.