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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Textareafield default value


Go to End


785 Views

Avatar
cwchong

Community Member, 13 Posts

7 January 2012 at 3:50pm

Hi, as i understand from the docs,

new TextareaField(
$name = "description",
$title = "Description",
$rows = 8,
$cols = 3,
$value = "This is the default description"
);

However, when i tried to add a new textfield to a page:
function getCMSFields() {
...
$fields->addFieldToTab("Root.Content", new TextareaField('test', 'test', 5, 10, 'default value'));
...
}

The textarea comes up with a blank content value.
The same "bug" occurs when using derivatives of TextareaField

Can anyone do a quick test on the latest 2.4.6 and check if this happens for you too?