>
> I am looking for some help on prepopulating a select form helper and
> setting a default selected value using Cake1.2. I have seen solutions
> but they are all in Cake1.1 Any help would be greatly appreciated!
>
> echo $form->select('Project.id', $projectNames, null, null, false);
I've not tested your code, but apparently it should be working.
As default selected option, you should define it with the third
argument in the $form->select[1].
In your view, give a pr( $this->viewVars ); to see if your predefined
options are really being passed to the view.
On Thu, Apr 2, 2009 at 5:39 PM, Miles J <mileswjohnson@gmail.com> wrote:
> (..)
> Only input() gets prepopulated, and input() calls select(), checkbox
> (), etc on its own.
Well, I use the the $form->select('MyModel.field', $myoptions)
prepopulated normally[2].
Best regards.
[1] http://api.cakephp.org/class/form-helper#method-FormHelperselect
[2] http://code.google.com/p/jaca4l/source/browse/trunk/app/views/processos/cadastrar.ctp
--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105
http://mfandrade.wordpress.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment