Hi.

I'm using this spiffy new automatically-generating-multiple-tickboxes
part of the form helper like this:

echo $form->input('Colour.multi_field', array(
        'options' => $colours,
        'label' => 'Colours',
        'multiple' => 'checkbox',
        'error' => array(
                'required' => 'Please choose at least one colour.'
        )
));

This is all well and good, causing $this->data to have values like
this:

    [Colour] => Array
        (
            [multi_field] => Array
                (
                    [0] => 4
                    [1] => 8
                )

        )

Which is fine, except this is what ends up in my database:

mysql> select * from colours_products;
+-----------+------------+
| colour_id | product_id |
+-----------+------------+
|         0 |          6 |
+-----------+------------+
1 row in set (0.01 sec)

The product ID is being saved just fine (albeit only once), but the
colour's not being stored. It should be saving colour ID 4 with
product ID 6, and colour ID 8 with product ID 6.

I'm not sure if this is relevant, but I'm trying to update three
hasAndBelongsToMany relationships at once: the product has-and-belongs-
to-many categories, colours, and sizes. I've created the form elements
in alphabetical order just in case that makes a difference.

Any help would be much appreciated.

Thanks,
Zoe.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to