Thought of that and tried it without $this->data, just plain text.

On Fri, Apr 30, 2010 at 6:12 PM, Ed Propsner <[email protected]> wrote:

> Be sure $this->data['Profile']['group'] matches one of the options
> exactly. Typos, capitalize, extra spaces, etc. will keep it from selecting.
> I had one that wouldn't select and the difference was 'this' and ' this '
>
>
> On Fri, Apr 30, 2010 at 11:07 AM, Jeremy Burns <[email protected]> wrote:
>
>> What about:
>>
>> $form->select('Profile.group', $options, array('selected' =>
>> $this->data['Profile']['group']));
>>
>> (in other words adding the model name to the select name)
>>
>>
>> Jeremy Burns
>> [email protected] <[email protected]>
>>
>>
>> On 30 Apr 2010, at 16:04, Andrei Mita wrote:
>>
>> I know, I fallowed the example but I'm missing something.
>>
>>
>> On Fri, Apr 30, 2010 at 6:01 PM, Ed Propsner <[email protected]>wrote:
>>
>>> I just tried this one and it works :
>>>
>>> $options=array('M'=>'Male','F'=>'Female');
>>> echo $form->select('gender',$options, array('selected' => 'M'));
>>>
>>> On Fri, Apr 30, 2010 at 11:00 AM, Andrei Mita <[email protected]>wrote:
>>>
>>>> It doesn't work :((
>>>>
>>>>
>>>>
>>>> On Fri, Apr 30, 2010 at 5:58 PM, Andrei Mita <[email protected]>wrote:
>>>>
>>>>> I've tried that. I'll try it again. If it works, I'm calling it a day
>>>>> :)
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Apr 30, 2010 at 5:53 PM, Ed Propsner <[email protected]>wrote:
>>>>>
>>>>>> Try this. I'm "almost" sure it will work 8-)
>>>>>>
>>>>>> $form->select('group', $options, array('selected' =>
>>>>>> $this->data['Profile']['group']));
>>>>>>
>>>>>> On Fri, Apr 30, 2010 at 10:17 AM, Andrei Mita 
>>>>>> <[email protected]>wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I'm making an edit form and I can't get the existing value to be
>>>>>>> selected into one of the select field.
>>>>>>>
>>>>>>> The classic input in the view: echo $form->input('group');
>>>>>>>
>>>>>>> I've changed that to a select:
>>>>>>>
>>>>>>> $options=array('Generatia 1'=>'Generatia 1','Generatia 2'=>'Generatia
>>>>>>> 2', 'Generatia 3'=>'Generatia 3');
>>>>>>> echo $form->select('group',$options);
>>>>>>>
>>>>>>> The existing value is in $this->data['Profile']['group'] and, in my
>>>>>>> example, is equal to "Generatia 2"
>>>>>>>
>>>>>>> How can I make that one selected?
>>>>>>>
>>>>>>> echo $form->select('group',$options,
>>>>>>> $this->data['Profile']['group']), as shown in the book, doesn't work. 
>>>>>>> What
>>>>>>> am I missing?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Toate cele bune,
>>>>>>> Andrei Mita
>>>>>>>
>>>>>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>>>>>> others with their CakePHP related questions.
>>>>>>>
>>>>>>> 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]<cake-php%[email protected]>For
>>>>>>>  more options, visit this group at
>>>>>>> http://groups.google.com/group/cake-php?hl=en
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>>>>> others with their CakePHP related questions.
>>>>>>
>>>>>> 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]<cake-php%[email protected]>For
>>>>>>  more options, visit this group at
>>>>>> http://groups.google.com/group/cake-php?hl=en
>>>>>>
>>>>>
>>>>>
>>>>
>>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>>> others with their CakePHP related questions.
>>>>
>>>> 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]<cake-php%[email protected]>For
>>>>  more options, visit this group at
>>>> http://groups.google.com/group/cake-php?hl=en
>>>>
>>>
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> 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]<cake-php%[email protected]>For
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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
>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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]<cake-php%[email protected]>For
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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