Index: wysiwyg.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg.js,v retrieving revision 1.15 diff -u -p -r1.15 wysiwyg.js --- wysiwyg.js 7 Jun 2009 23:07:22 -0000 1.15 +++ wysiwyg.js 18 Jul 2009 18:36:24 -0000 @@ -45,7 +45,7 @@ Drupal.behaviors.attachWysiwyg = functio $('.wysiwyg:not(.wysiwyg-processed)', context).each(function() { var params = Drupal.wysiwyg.getParams(this); - var $this = $(this); + var $this = $(this).addClass('wysiwyg-processed'); // Directly attach this editor, if the input format is enabled or there is // only one input format at all. if (($this.is(':input') && $this.is(':checked')) || $this.is('div')) { @@ -65,7 +65,10 @@ Drupal.behaviors.attachWysiwyg = functio }); } } - $this.addClass('wysiwyg-processed'); + // Detach any editor when the containing form is submitted. + $('#' + params.field).parents('form').submit(function () { + Drupal.wysiwygDetach(context, params); + }); }); };