Hi,
I'm trying to set default value for the check-box group for frontend form, but I can't do this, the "default" parameter is ignored,
I've tried to check this on core .
formCheckbox.php tried to mark option as checked by this function $this->isChecked($arrOption),
and this function check for if (empty($this->varValue) && $arrOption['default']), if it's empty it mark 1 option as default, if it set, it mark correct one.
The problem is that there no $this->varValue by default (you can't set it in DCA), and also there are no $arrOption['default'], because if you try to add 'default' to options array - it will create option called default. if you put default to the eval() or as separated options, it will be ignored.
logic for default values is written in the widget.php, and seems that it doesn't work for checkboxes
this is the example of my DCA array
if someone knew how to do this, please tell me.Code:$GLOBALS['TL_DCA']['tl_member']['fields']['oktolist'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_member']['oktolist'], 'inputType' => 'checkbox', 'default' => '????' 'eval' => array('mandatory' => false, 'default' => '????', 'tl_class' => 'w50', 'configure' => true, 'feEditable' => true ), 'options' => array('aaa','bbb','ccc') );
Bookmarks