Hello! You could try something like what I am doing:

Controller code: (in the add action)
---------------------------------------------------

        //grab list of Projects for dropdown list
        $projectNames = $this->ProjectUpdate->Project->find('list', array
('fields' => 'Project.name', 'order' => 'Project.name ASC'));

        $this->set('projectNames', $projectNames);


View code:
--------------------------------------------------
        echo $form->input('Project.id', array('options' => $projectNames));


Hope this helps!

Chris



On Apr 3, 7:27 am, "soldier.coder" <[email protected]>
wrote:
> Hi all,
> In my rosters table I have a course_id, that points to the primary key
> in courses table, and I have a student_id, that likewise points to
> primary key in students, table...
>
> Right now, in my baked of views/rosters/add.ctp:
>
> <div class="rosters form">
> <?php echo $form->create('Roster');?>
>    <fieldset>
>        <legend><?php __('Add Roster');?></legend>
>    <?php
>     echo $form->input('course_id');
>     echo $form->input('student_id');
> ?>
>    </fieldset>
> <?php echo $form->end('Submit');?>
>
> Right now, those render as listboxes with the id's as what you choose.
> In courses table there is a course_name field...  How do I get it to
> *SHOW* the course_name, but select the course_id??
--~--~---------~--~----~------------~-------~--~----~
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