Both 'selected'=> & 'default'=> seem to do the trick. Thanks!
On May 5, 6:44 am, andy <[email protected]> wrote:
> Seehttp://book.cakephp.org/view/199/options-selected. In the view,
> you will need to do something like this:
>
> $form->input('fieldname', array('options' => array($listvalue),
> 'selected' => 'desiredselectvalue') );
>
> On May 4, 3:56 pm, qwanta <[email protected]> wrote:
>
> > In the controller I do a find('list') to get an array ready for
> > populating a select box. I am quite stumped as to how I would set the
> > selected index of the select box in the view.
> > This is a case where the automagic situation (editing a record) is not
> > applicable - it is a log entry form and a new record each time.
>
> > thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---