i have found the way to build an array of checkboxes. but when i update this at the controller class the checkbox in false are not visible. so i must clear all the entries first and replace this with the new array.
<?php function edit() { if(isset($this->data['Blogs_tags']['checkID'])) { $ID = $this->data['Blogs_tags']['blogs_id']; $t = new BlogsTags; $d = $t->findAllByblogs_id($ID); foreach($d as $value): $t->delete_ByField($ID, $value['blogs_tags']['tags_id']); endforeach; foreach($this->data['Blogs_tags']['checkID'] as $value): if(isset($value)){ $param = array(); $param['blogs_id'] = $ID; $param['tags_id'] = $value; $t->save($param); } else{ if ($bol) { $t->delete_ByField($ID, $value); } } endforeach; } } ?> Does anyone have a better idea? --- Dan On 28 feb, 14:43, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > i want to post a array with multiples IDs, at an relationchip table. > All this id are generated by a list of checkboxes. > <input type="hidden" name="data[customs][from_id]" value="27" id="" / > > <input type="checkbox" name="data[customs][tags_id]" value="1" /> > design<br /> > <input type="checkbox" name="data[customs][tags_id]" value="1" /> > architecture<br /> > <input type="checkbox" name="data[customs][tags_id]" value="1" /> > videos<br /> > > and my save function = > $t = new customs; > $t->save($this->data['customs']); > > do you have any idea ? > > --- > Dan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---