I have a basic HABTM relationship with two tables called "Best
Practices" and "Topics". On the page where I edit the Best Practice,
which hasAndBelongsToMany Topics, I have a selectTag that is
automatically populated with topics in the $topics array:
<?= $html->selectTag('Topic/Topic', $topics, null, array('multiple' =>
'multiple')) ?>
This works great when simply adding the Best Practice. But when I use
that same form to edit the Best Practice, the selectTag doesn't
auto-select the saved Topics. In other words, I assume that it will
automatically set the "default value", so to speak, like $html->input
and $html->textarea.
Is there an elegant way to do this, more than what is found on this
page:
http://groups-beta.google.com/group/cake-php/browse_thread/thread/1bf118d0210426e2/94a7689cfeaed6d5?lnk=gst&q=habtm+selected&rnum=1#94a7689cfeaed6d5
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---