5098 Posts in 1518 Topics by 1115 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 746 Views |
-
How to add HtmlEditorField

28 February 2011 at 7:34pm Last edited: 28 February 2011 10:36pm
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?
-
Re: How to add HtmlEditorField

1 March 2011 at 6:00pm
Hello,
Someone there, can anyone throw some light on this issue, I got stuck up in this.
Thanks
| 746 Views | ||
|
Page:
1
|
Go to Top |

