Do you load the elements in between form->create and form->end?

On Thu, May 20, 2010 at 6:01 PM, kryska <kryskasan...@gmail.com> wrote:

> Hi!
> There is a view with a form inside.
> Two dropdown lists; depending on the first value selected, fill the
> second dropdown. And depending on the value selected on the secon
> dropdown, i load different elements.ctp inside a div. Finally, i end
> the form:
>
>
> echo $form-
> >create(array('controller'=>'Detallemenu','action'=>'add'));
> echo $form-
> >select('seccion_id',array($secciones),null,array('id'=>'secciones'),Select
> one type..')
> echo $form->select('tipo_id',array(),null,array('id'=>'tipos'),'Select
> one type..')
>
> echo $ajax->observeField('secciones',array('url'=>"http://127.0.0.1/
> elmolinodesanlazaro.com/prueba/adm/Menus/
> update_tipo_select",'update'=>'tipos'));
>
> echo $ajax-
>
> >observeField('tipos',array('url'=>'actualizarCarta','update'=>'divupdate'));
>
> <div id="divupdate"> </div>
>
> The action in the controller to load an element.ctp inside the div:
>
> function actualizarCarta($id = null) {
>        $tipo_id = $this->data['Detallemenu']['tipo_id'];
>        $options = $this->Detallemenu->Tipo-
> >find('list',array('fields'=>'Tipo.nombre','conditions'=>array('id'=>
> $tipo_id)));
>                $stringNombre = implode(',', Set::extract($options,
> '{n}.Tipo.nombre'));
>        array($this->render(null, 'ajax', '/elements/'.$stringNombre)); }
> echo $form->end(array('label'=>'Crear MenĂº','class'=>'button'))
>
> Everything works except that do not save the fields that are inside
> the element.ctp
> If the element is not loaded dynamically, (if i write inside the div:
> $this->element('mielement') ), it saves the fields inside the view and
> inside the element..
> But by loading dynamically, it only saves the fileds inside the view,
> but it do not save the fields inside the element...
>
> Please, any help would be awesome..i`m going crazy with this!
>
> Thank you!
>
> 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 cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to