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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

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

Textareafield default value


Go to End


1002 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?