Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

TinyMCE editor not submitting content


Go to End


2 Posts   3322 Views

Avatar
NicoHaase

Community Member, 6 Posts

30 April 2012 at 6:48pm

Hi folks,
I'm currently developing a website which should contain a simple front-end administration. The form is generated using $fields = singleton('DataObject')->getFrontEndFields(), and my dataobject contains three fields of type HTMLText. These should be editable through TinyMCE editors, which is done through the framework. Well, they are editable, but the content of these fields is empty after submitting the form. I tried really a lot, from tracking down the JS code to tinyMCE.triggerSave() (not resolving the problem), to call of tinyMCE.getInstanceById('Form_EditForm_FieldName').getContent() (which returns an empty string),.... and after hours of headache, I have no clue left where to search for a call I omitted... can anyone help here?
Kind regards from sunny Germany
Nico

Avatar
NicoHaase

Community Member, 6 Posts

1 May 2012 at 11:16pm

Just in case anyone else runs into this problem, this is the solution. Short and simple....

$mceConfig = HtmlEditorConfig::get();
$mceConfig->disablePlugins('spellchecker', 'emotions');
$mceConfig->setOptions(array(
			'mode' => 'none'
));
HtmlEditorConfig::set_active();