Re: Form dropdown multiple selected array not working

2011-10-24 Thread Tilen Majerle
it should be "disabled" => "disabled" or "disabled" => "checkbox" instead "disabled" => true -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/10/25 MetZ > Hi all.. > > I just wanted to let anyone else with similar problem know how I > solved this. > > in view! > if($this->data['Co

Re: Form dropdown multiple selected array not working

2011-10-24 Thread MetZ
Hi all.. I just wanted to let anyone else with similar problem know how I solved this. in view! data['Content']['category_id'] != '') { $cont_cats = explode(",",$this->data['Content']['category_id']); }else{ $cont_cats = ''; } echo $form- >input('c

Re: Form dropdown multiple selected array not working

2011-10-13 Thread WebbedIT
If this is a HABTM relationship, which it would have to be to allow many contents to be related to many categories, then you have your field named wrong. You essentially have a belongsTo field there where one row can only have one relation to Category via Content.category_id, what you need is a fi

Re: Form dropdown multiple selected array not working

2011-10-12 Thread MetZ
It is not to display all categories (options), it is on EDIT, to set SELECTED on a category option that are selected. Example: admin_edit.ctp view echo $form->input('Content.category_id',array('selected'=>$this- >data['Content'] ['category_id'],'size'=>'10','div'=>false,'label'=>false,'type' =>'se

Re: Form dropdown multiple selected array not working

2011-10-11 Thread euromark
why not 'options' => $categories ? since $categories probably is an array and contains the keys On 10 Okt., 21:38, MetZ wrote: > Hi all. > > I am having trouble setting the selected to the options when selected > is an array. > > (This is a edit content view) > Dropdown display all categories (

Form dropdown multiple selected array not working

2011-10-11 Thread MetZ
Hi all. I am having trouble setting the selected to the options when selected is an array. (This is a edit content view) Dropdown display all categories (using generatetreelist to list my categories) echo $form->input('Content.category_id',array('selected'=>array($this- >data['Content'] ['catego