I solved the problem.

The trick is to add the ID of the ingredient like so: echo $form->input
('IngredientList.'.$x.'.id', array('type'=>'hidden'));

You can see it in context below.


<?php
$x = 0;
foreach($ingredient_list as $ingredient)
{
?>
<table>
        <tr>
                <td><?php echo $form->input('IngredientList.'.$x.'.amount'); 
?></td>
                <td><?php
                        echo 
$form->label('IngredientList.'.$x.'.measurement_type_id',
'Measurement Type');
                        echo 
$form->select('IngredientList.'.$x.'.measurement_type_id',
$measurement_types);
                        ?></td>
                <td><?php echo 
$form->input('IngredientList.'.$x.'.description'); ?
></td>
                <td><?php
                        echo $form->label('IngredientList.'.$x.'.ingredient_id',
'Ingredient');
                        echo 
$form->select('IngredientList.'.$x.'.ingredient_id',
$ingredients);

                        ?></td>
        </tr>
</table>
<?php
echo $form->input('IngredientList.'.$x.'.id', array
('type'=>'hidden'));
$x++;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to