Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 3948)
+++ /CKEditor/trunk/CHANGES.html	(revision 3949)
@@ -163,4 +163,5 @@
 		<li><a href="http://dev.fckeditor.net/ticket/3989">#3989</a> : Host page horizontal scrolling a lot when on having righ-to-left direction.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/4001">#4001</a> : Create link around existing image result incorrect.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/3988">#3988</a> : Destroy editor on form submit event cause error.</li>
 	</ul>
 	<h3>
Index: /CKEditor/trunk/_source/core/editor.js
===================================================================
--- /CKEditor/trunk/_source/core/editor.js	(revision 3948)
+++ /CKEditor/trunk/_source/core/editor.js	(revision 3949)
@@ -284,8 +284,9 @@
 			if ( form )
 			{
-				form.on( 'submit', function()
-					{
-						editor.updateElement();
-					});
+				function onSubmit()
+				{
+					editor.updateElement();
+				}
+				form.on( 'submit',onSubmit );
 
 				// Setup the submit function because it doesn't fire the
@@ -309,5 +310,11 @@
 				}
 			}
-		}
+
+				// Remove 'submit' events registered on form element before destroying.(#3988)
+				editor.on( 'destroy', function()
+				{
+					form.removeListener( 'submit', onSubmit );
+				} );
+			}
 	};
 
@@ -452,4 +459,5 @@
 
 			this.theme.destroy( this );
+			this.fire( 'destroy' );
 			CKEDITOR.remove( this );
 		},
Index: /CKEditor/trunk/_source/themes/default/theme.js
===================================================================
--- /CKEditor/trunk/_source/themes/default/theme.js	(revision 3948)
+++ /CKEditor/trunk/_source/themes/default/theme.js	(revision 3949)
@@ -181,5 +181,8 @@
 
 			if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
+			{
 				editor.element.show();
+				delete editor.element;
+			}
 		}
 	};
