17452 Posts in 4473 Topics by 1971 members
|Go to End|
10 July 2007 at 4:43am
I'm a newbie to the silverstripe cms, but must say: What a great framework is this!!
I'm trying to add a checkboxgroup in the cms with some text as the keys, but I only get id's as the value.
In the documentation is told that you can have text as a key instead of an id in a checkboxgroup:
I've tried it with:
but still there are id's as keys.
Can somebody help me out?
10 July 2007 at 8:18am Last edited: 10 July 2007 8:19am
You need to pass keys as array keys. This is explained in Tutorial 3 that Andy made
$browsers = array(
'FF' => 'Firefox',
'IE' => 'Internet Explorer',
'Safari' => 'Safari',
'Opera' => 'Opera',
'Lynx' => 'Lynx'
$browserField = new OptionsetField('Browser', 'Your Favourite Browser', $browsers)
10 July 2007 at 6:31pm
Thanks for your reply,
Stupid of me not to try it like this
10 July 2007 at 6:38pm
Sweet. Note the dropdown/optionset/checkbox are basically all the same thing in terms of passing data to them.
|Go to Top|