You're missing 'type' parameter...
echo $form->input('submited_by', array('type' => 'select', 'options'
=> $managers, 'selected' => $user_id));
BTW, you can read user's id directly form your view with the session
helper... $session->read('UserId');
On Oct 5, 7:00 pm, "$$$" <[email protected]> wrote:
> add function in the controller:-
> $userid = $this->Session->read('UserId');
> $this->set(compact('userid'));
>
> add.ctp
> echo $form->input('submitted_by',array('options'=>$managers,'default'=>
> $userid));
> echo $form->input('submitted_by',array('options'=>
> $managers,'default'=>'$userid'));
>
> this doesnt work....Actually I want to automatically pull up the name
> of the person from a managers dropdownlist which contains all the
> managers who logged in this session to use a form
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---