Hi Guys can you help:
When using Automagic Select on a HABTM I cant get the automagic
multiple selct box to show the selected items when I edit a user
( showing & saving data works great on add)
Tables:
Users
States
User_States
Users HABTM States
In my controller I have :
function add(){
-----Code ----
$states = $this->User->State->find('list',array('fields'=>array
('id','name')));
$this->set(compact('states'));
if($this->User->saveAll($this->data)){ < --------- works great
------Code ---
}
in my add view
echo $this->form->input('State.State.); <---- Works Great!!!
Here is the problem?
--- Edit ---
in controller
function edit(){
-----Code ----
$states = $this->User->State->find('list',array('fields'=>array
('id','name')));
$this->set(compact('states'));
------Code ---
}
edit view
echo $this->form->input('State.State); < ---- shows list but does not
show any as selected;
echo $this->form->input('State);< ---- shows list but does not show
any as selected;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---