ckeditor 3.6.x firefox 11 value not saved

Recently, we faced a problem of form value not being saved. The problem only appears to those fields using ckeditor. And what weire is that the value is not blank; instead it keep passing the orginal value to server. So the problem is that the value got reverted to its original value by the time we hit submit….   I think this problem does not always occur because there are only two people facing this problem according to the ckeditor forum.

My setting is pasted below…  and we are using the jquery plugin.

$(“.newbodytext”).ckeditor(function (evt) { }, {

filebrowserBrowseUrl: ‘some/url’,

filebrowserImageBrowseUrl: ‘some/url’,

filebrowserFlashBrowseUrl: ‘some/url’,

autoGrow_onStartup: true,

width: ‘600’,

autoUpdateElement: true,

contentsCss: [‘/cms/Content/stylesheet.css’, ‘/cms/Content/field.css’, ‘/cms/Content/backend.css’],

bodyClass: ‘content_column content’,

toolbar: [

{ name: ‘document’, items: [‘Source’, ‘Preview’] },

{ name: ‘clipboard’, items: [‘Cut’, ‘Copy’, ‘Paste’, ‘PasteText’, ‘PasteFromWord’, ‘-‘, ‘Undo’, ‘Redo’] },

{ name: ‘insert’, items: [‘Image’, ‘Flash’, ‘Table’, ‘HorizontalRule’, ‘SpecialChar’, ‘PageBreak’, ‘Iframe’] },

{ name: ‘editing’, items: [‘Find’, ‘Replace’, ‘-‘, ‘SelectAll’] },

{ name: ‘paragraph’, items: [‘NumberedList’, ‘BulletedList’, ‘-‘, ‘Outdent’, ‘Indent’, ‘-‘, ‘Blockquote’, ‘CreateDiv’, ‘-‘, ‘JustifyLeft’, ‘JustifyCenter’, ‘JustifyRight’, ‘JustifyBlock’] },

//’/’,

{name: ‘styles’, items: [‘Styles’, ‘FontSize’, ‘Format’] },

{ name: ‘basicstyles’, items: [‘Bold’, ‘Italic’, ‘Underline’, ‘Strike’, ‘Subscript’, ‘Superscript’, ‘-‘, ‘RemoveFormat’] },

{ name: ‘links’, items: [‘Link’, ‘Unlink’, ‘Anchor’] },

{ name: ‘colors’, items: [‘TextColor’, ‘BGColor’] }

// { name: ‘tools’, items: [‘Maximize’, ‘-‘, ‘About’] }

],

extraPlugins: ‘stylesheetparser’,

stylesSet: []

});

 

Solution

The solution is to manually destroy ckeditor when the form submit and tell it not to revert values.

$(‘form’).submit(function (e) {

//work around for firefox 11 plus ckeditor 3.6.2/3.6.3

if ($.browser.mozilla) {  //sometimes this problem also occurs in IE, just replace it with a true.

for (var instanceName in CKEDITOR.instances) {

if (CKEDITOR.instances[instanceName]) CKEDITOR.instances[instanceName].destroy(false);

}

}

});

for asp.net webform, you can find some hints from this link.

http://stackoverflow.com/questions/1230573/how-to-capture-submit-event-using-jquery-in-an-asp-net-application

 

Leave a Reply