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

How to use the HtmlEditorField like in the CMS?


Go to End


3 Posts   1354 Views

Avatar
wee-man

Community Member, 21 Posts

2 December 2012 at 1:59am

Hello,

does anyone have an example how to use the HtmlEditorField like in the CMS? What are the requirements and how is the field defined and initialized?

Thanks and Greetings
Michael

Avatar
Willr

Forum Moderator, 5523 Posts

2 December 2012 at 5:15pm

Create an HtmlEditorField in your form and that should include all the javascript required for the field (at least in 2.4 it does).

http://api.silverstripe.org/3.0/forms/fields-formattedinput/HtmlEditorField.html

Avatar
wee-man

Community Member, 21 Posts

5 December 2012 at 6:34am

Since I'm Ajax loading the form fields the trick was to require the JS files at initial page load and reinitialize the html editor fields after a complete Ajax call.