Re: selected items in HABTM multiple select

2006-08-07 Thread Jon Bennett
Any thoughts ?? how about adding this function to your app_controller.php function getSelectedItems ($data) { $return = array(); foreach ($data as $row) { $return[$row['id']] = $row['name']; }

Re: selected items in HABTM multiple select

2006-08-07 Thread Olivier Percebois-Garve
You're definitely right. thanks a lot. I should think about it every time I see something recurrent in my code. Jon Bennett wrote: Any thoughts ?? how about adding this function to your app_controller.php function getSelectedItems ($data) { $return = array(); foreach

selected items in HABTM multiple select

2006-07-31 Thread Olivier Percebois-Garve
Is there an elegant way to build the list of selected items to feed the $html-selectTag() in a HABTM relation ??I ended with for instance: $materials_selected_designations = array(); for($i=0; $i sizeof($this-params['data']['Material']); $i++){