I have an events table which has event_name as one of the fields. The
value for this field is restricted (has to be a value from a set of
values, like 'Birthday', 'Anniversary', etc). So it is better to have
a dropdown instead of textbox in the views (add & edit).

Since these are not part of any table, I cannot use generateList in
the controller. So I used the below code in the controller.

$event_names = array('1'=>'Birthday', '2'=>'Anniversary', /*... etc...
*/);
$this->set(compact('event_names'));

I am using the below code for event_name field in the views.

echo $form->input('event_name');


This works for add and dropdown appears. But in edit, the dropdown
does not automatically select the proper value according to the value
of event_name from the database.

Is there something I am missing?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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