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   466 Views

Avatar
wee-man

2 December 2012 at 1:59am Community Member, 21 Posts

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

2 December 2012 at 5:15pm Forum Moderator, 5511 Posts

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

5 December 2012 at 6:34am Community Member, 21 Posts

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.