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.

Form Questions /

How to use the HtmlEditorField like in the CMS?


Reply


3 Posts   554 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, 5513 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.