You can pre-populate the $this->data array:

In your controller method:

$this->data['Model']['field'] = 1;

(where 1 is value you want to pre-select)

or,

in the view:

<?echo $form->input("field", array("options"=>$options, "default"=>1) ?
>

On May 4, 9: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
-~----------~----~----~----~------~----~------~--~---

Reply via email to