Sunday, February 28, 2010

Showing selected values in a HABTM

Hey everyone, I did try looking around here and on google for this
issue, however I can only find data that relates to problems 3 years
ago, which doesn't help as much as I'd like it to. I could likely use
it, but I figured that by now, Cake must have a more elegant way of
doing this.

I want to show the data that was selected in a HABTM in my edit form.
I can see that the data is populated in $this->data when I do a
read(), however it doesn't seem to be populating the multi-select box
I have created.

This is the code for the multi-select box:
echo $form->input('Activity', array('label' => false, 'type' =>
'select', 'options' => $dbactivities, 'multiple' => true));

Can anyone tell me how to display what items are selected?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: