I have created a new module for CMS, I am adding HtmlEditorField like this:
$fields = new FieldSet(
// TODO The ID field needs to be hidden but while testing make it readonly
new ReadonlyField('ID','id #',$id),
new TextField('article_name', "Article Name", ""),
$dateField = new DateField('article_date', "Article Date", ""),
new CheckboxField('article_publish',"Publish",""),
new CheckboxField('article_archive',"Archive",""),
new HtmlEditorField('article_content', "Content",15,20)
);
and created dataobject like this:
class Articles extends DataObject {
static $db = array(
'article_name' => 'Varchar',
'article_date' => 'Date',
'article_publish' => 'Boolean',
'article_archive' => 'Boolean',
'article_content' => 'HTMLText'
);
}
But when I submit my form, I get the validation error "article_content Content Required" even though I have fed all the fields with data , if I remove the validation, the form is submitted but the data(from HtmlEditorField) is not saved to the database ??
Please note that the same form works fine when I replace HtmlEditorField with TextareaField.
How can I get the HtmlEditorField working?